home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1997 April / EnigmA AMIGA RUN 17 (1997)(G.R. Edizioni)(IT)[!][issue 1997-04][EAR-CD].iso / EARCD / comm / term / term_47a_pch.lha / Source / gtlayout-38.3 / LT_New.c < prev    next >
C/C++ Source or Header  |  1996-11-12  |  93KB  |  3,466 lines

  1. /*
  2. **    GadTools layout toolkit
  3. **
  4. **    Copyright © 1993-1996 by Olaf `Olsen' Barthel
  5. **        Freely distributable.
  6. **
  7. **    :ts=4
  8. */
  9.  
  10. #ifndef _GTLAYOUT_GLOBAL_H
  11. #include "gtlayout_global.h"
  12. #endif
  13.  
  14.  
  15. /*****************************************************************************/
  16.  
  17.  
  18. VOID
  19. LT_AddL(LayoutHandle *handle,LONG type,ULONG labelID,LONG id,...)
  20. {
  21.     if(handle)
  22.     {
  23.         struct TagItem    *tagList;
  24.         va_list          varArg;
  25.  
  26.         va_start(varArg,id);
  27.  
  28.         tagList = (struct TagItem *)varArg;
  29.  
  30.         if(handle->LocaleHook)
  31.         {
  32.             STRPTR label;
  33.  
  34.             label = (STRPTR)CallHookPkt(handle->LocaleHook,handle,(APTR)labelID);
  35.  
  36.             LT_AddA(handle,type,label,id,tagList);
  37.         }
  38.         else
  39.             handle->Failed = TRUE;
  40.  
  41.         va_end(varArgs);
  42.     }
  43. }
  44.  
  45.  
  46. /*****************************************************************************/
  47.  
  48.  
  49. VOID
  50. LT_New(LayoutHandle *handle,...)
  51. {
  52.     va_list VarArgs;
  53.  
  54.     va_start(VarArgs,handle);
  55.     LT_NewA(handle,(struct TagItem *)VarArgs);
  56.     va_end(VarArgs);
  57. }
  58.  
  59.  
  60. /*****************************************************************************/
  61.  
  62.  
  63. VOID
  64. LT_Add(LayoutHandle *Handle,LONG Type,STRPTR Label,LONG ID,...)
  65. {
  66.     va_list VarArgs;
  67.  
  68.     va_start(VarArgs,ID);
  69.     LT_AddA(Handle,Type,Label,ID,(struct TagItem *)VarArgs);
  70.     va_end(VarArgs);
  71. }
  72.  
  73.  
  74. /*****************************************************************************/
  75.  
  76.  
  77. VOID LIBENT
  78. LT_AddA(REG(a0) LayoutHandle *Handle,REG(d0) LONG Type,REG(d1) STRPTR Label,REG(d2) LONG ID,REG(a1) struct TagItem *TagList)
  79. {
  80.     struct TagItem *TagItem;
  81.  
  82.     if(!Handle || Handle->Failed)
  83.         return;
  84.  
  85.     if(Type < GENERIC_KIND)
  86.     {
  87.         Handle->Failed = TRUE;
  88.         return;
  89.     }
  90.  
  91.     if(Type == VERTICAL_KIND || Type == HORIZONTAL_KIND || Handle->TopGroup)
  92.     {
  93.         ObjectNode *Node;
  94.         ULONG IDCMP;
  95.  
  96.         IDCMP = NULL;
  97.  
  98.         switch(Type)
  99.         {
  100.             case BUTTON_KIND:
  101.  
  102.                 IDCMP = BUTTONIDCMP;
  103.                 break;
  104.  
  105.             case CHECKBOX_KIND:
  106.  
  107.                 IDCMP = CHECKBOXIDCMP | IDCMP_MOUSEBUTTONS;
  108.                 break;
  109.  
  110.             case LISTVIEW_KIND:
  111.  
  112.                 IDCMP = LISTVIEWIDCMP;
  113.                 break;
  114.  
  115.             case MX_KIND:
  116.  
  117.                 IDCMP = MXIDCMP | IDCMP_MOUSEBUTTONS;
  118.                 break;
  119.  
  120.             case CYCLE_KIND:
  121.  
  122.                 IDCMP = CYCLEIDCMP;
  123.                 break;
  124.  
  125.             case PALETTE_KIND:
  126.  
  127.                 IDCMP = PALETTEIDCMP;
  128.                 break;
  129.  
  130.             case SLIDER_KIND:
  131.  
  132.                 IDCMP = SLIDERIDCMP;
  133.                 break;
  134.  
  135.             case SCROLLER_KIND:
  136.  
  137.                 IDCMP = SCROLLERIDCMP | ARROWIDCMP;
  138.                 break;
  139.  
  140.             case INTEGER_KIND:
  141.  
  142.                 IDCMP = STRINGIDCMP | IDCMP_GADGETDOWN | IDCMP_INTUITICKS;
  143.                 break;
  144.  
  145.             case FRAME_KIND:
  146.  
  147.                 IDCMP = IDCMP_MOUSEBUTTONS;
  148.                 break;
  149.  
  150.             case FRACTION_KIND:
  151.             case STRING_KIND:
  152.             case PASSWORD_KIND:
  153.  
  154.                 IDCMP = STRINGIDCMP | IDCMP_GADGETDOWN;
  155.                 break;
  156.  
  157. #ifdef DO_LEVEL_KIND
  158.             case LEVEL_KIND:
  159.  
  160.                 IDCMP = IDCMP_GADGETDOWN | IDCMP_MOUSEMOVE | IDCMP_GADGETUP;
  161.                 break;
  162. #endif    /* DO_LEVEL_KIND */
  163.  
  164.             case END_KIND:
  165.  
  166.                 Handle->CurrentGroup = Handle->CurrentGroup->Special.Group.ParentGroup;
  167.                 return;
  168.  
  169. #if defined(DO_POPUP_KIND) && defined(DO_BOOPSI_KIND)
  170.             case POPUP_KIND:
  171.  
  172.                 IDCMP = IDCMP_GADGETUP;
  173.  
  174.                 if(!V39)
  175.                     Type = CYCLE_KIND;    // POPUP_KIND doesn't work well under v37
  176.  
  177.                 break;
  178. #endif
  179.  
  180. #if defined(DO_TAB_KIND) && defined(DO_BOOPSI_KIND)
  181.             case TAB_KIND:
  182.  
  183.                 IDCMP = IDCMP_GADGETUP;
  184.                 break;
  185. #endif
  186.         }
  187.  
  188.         Handle->IDCMP |= IDCMP;
  189.  
  190.         if(Node = LTP_CreateObjectNode(Handle,Type,ID,Label))
  191.         {
  192.             struct MinList *ParentList;
  193.             LONG FirstLabel;
  194.             LONG LastLabel;
  195.             LONG *LabelTable;
  196.             LONG *LineTable;
  197.             LONG FirstLine;
  198.             LONG LastLine;
  199.             STRPTR BoxLine;
  200.  
  201.             BoxLine = NULL;
  202.             LabelTable = LineTable = NULL;
  203.             FirstLabel = LastLabel = FirstLine = LastLine = -1;
  204.             Type = Node->Type;
  205.  
  206.             if(Type == GROUP_KIND)
  207.             {
  208.                 Node->Special.Group.ParentGroup = Handle->CurrentGroup;
  209.  
  210.                 if(!ID)
  211.                     Node->ID = Handle->GroupID--;
  212.  
  213.                 if(!Handle->TopGroup)
  214.                 {
  215.                     Handle->TopGroup = Node;
  216.  
  217.                     ParentList = NULL;
  218.                 }
  219.                 else
  220.                     ParentList = &Handle->CurrentGroup->Special.Group.ObjectList;
  221.  
  222.                 Handle->CurrentGroup = Node;
  223.  
  224.                 NewList((struct List *)&Node->Special.Group.ObjectList);
  225.             }
  226.             else
  227.                 ParentList = &Handle->CurrentGroup->Special.Group.ObjectList;
  228.  
  229.             if(Label && !Node->NoKey)
  230.             {
  231.                 LONG Len;
  232.  
  233.                 for(Len = 0 ; Label[Len] ; Len++)
  234.                 {
  235.                     if(Label[Len] == '_')
  236.                     {
  237.                         Node->Key = ToLower(Label[Len + 1]);
  238.  
  239.                         break;
  240.                     }
  241.                 }
  242.             }
  243.  
  244.             if(TagList)
  245.             {
  246.                 struct TagItem *TempList = TagList;
  247.  
  248.                 while(TagItem = NextTagItem(&TempList))
  249.                 {
  250.                     switch(TagItem->ti_Tag)
  251.                     {
  252.                         case LA_BYTE:
  253.  
  254.                             Node->Storage         = (APTR)TagItem->ti_Data;
  255.                             Node->StorageType    = STORAGE_BYTE;
  256.  
  257.                             LTP_GetStorage(Node);
  258.  
  259.                             break;
  260.  
  261.                         case LA_UBYTE:
  262.  
  263.                             Node->Storage         = (APTR)TagItem->ti_Data;
  264.                             Node->StorageType    = STORAGE_UBYTE;
  265.  
  266.                             LTP_GetStorage(Node);
  267.  
  268.                             break;
  269.  
  270.                         case LA_WORD:
  271.  
  272.                             Node->Storage         = (APTR)TagItem->ti_Data;
  273.                             Node->StorageType    = STORAGE_WORD;
  274.  
  275.                             LTP_GetStorage(Node);
  276.  
  277.                             break;
  278.  
  279.                         case LA_UWORD:
  280.  
  281.                             Node->Storage         = (APTR)TagItem->ti_Data;
  282.                             Node->StorageType    = STORAGE_UWORD;
  283.  
  284.                             LTP_GetStorage(Node);
  285.  
  286.                             break;
  287.  
  288.                         case LA_LONG:
  289.  
  290.                             Node->Storage         = (APTR)TagItem->ti_Data;
  291.                             Node->StorageType    = STORAGE_LONG;
  292.  
  293.                             LTP_GetStorage(Node);
  294.  
  295.                             break;
  296.  
  297.                         case LA_ULONG:
  298.  
  299.                             Node->Storage         = (APTR)TagItem->ti_Data;
  300.                             Node->StorageType    = STORAGE_ULONG;
  301.  
  302.                             LTP_GetStorage(Node);
  303.  
  304.                             break;
  305.  
  306.                         case LA_STRPTR:
  307.  
  308.                             Node->Storage         = (APTR)TagItem->ti_Data;
  309.                             Node->StorageType    = STORAGE_STRPTR;
  310.  
  311.                             LTP_GetStorage(Node);
  312.  
  313.                             break;
  314.  
  315.                         case LAXB_FullSize:
  316.  
  317.                             if(Type == XBAR_KIND || Type == YBAR_KIND)
  318.                                 Node->Special.Bar.FullSize = TagItem->ti_Data;
  319.  
  320.                             break;
  321.  
  322.                         case LA_LabelTable:
  323.  
  324.                             LabelTable = (LONG *)TagItem->ti_Data;
  325.                             break;
  326.  
  327.                         case LA_FirstLabel:
  328.  
  329.                             FirstLabel = TagItem->ti_Data;
  330.                             break;
  331.  
  332.                         case LA_LastLabel:
  333.  
  334.                             LastLabel = TagItem->ti_Data;
  335.                             break;
  336.  
  337.                         case LA_LastGadget:
  338.  
  339.                             if(Type == INTEGER_KIND)
  340.                                 Node->Special.Integer.LastGadget = TagItem->ti_Data;
  341.  
  342.                             if(Type == STRING_KIND || Type == PASSWORD_KIND || Type == FRACTION_KIND)
  343.                                 Node->Special.String.LastGadget = TagItem->ti_Data;
  344.  
  345.                             break;
  346.  
  347.                         case LA_LabelChars:
  348.  
  349.                             Node->LabelChars = TagItem->ti_Data;
  350.  
  351.                             break;
  352.  
  353.                         case LA_HistoryLines:
  354.  
  355.                             if(Type == INTEGER_KIND)
  356.                                 Node->Special.Integer.MaxHistoryLines = TagItem->ti_Data;
  357.  
  358.                             if(Type == STRING_KIND || Type == PASSWORD_KIND || Type == FRACTION_KIND)
  359.                                 Node->Special.String.MaxHistoryLines = TagItem->ti_Data;
  360.  
  361.                             break;
  362.  
  363.                         case LA_HistoryHook:
  364.  
  365.                             if(Type == INTEGER_KIND)
  366.                                 Node->Special.Integer.HistoryHook = (struct Hook *)TagItem->ti_Data;
  367.  
  368.                             if(Type == STRING_KIND || Type == FRACTION_KIND)
  369.                                 Node->Special.String.HistoryHook = (struct Hook *)TagItem->ti_Data;
  370.  
  371.                             break;
  372.  
  373.                         case LAIN_IncrementerHook:
  374.  
  375.                             if(Type == INTEGER_KIND)
  376.                                 Node->Special.Integer.IncrementerHook = (struct Hook *)TagItem->ti_Data;
  377.  
  378.                             break;
  379.  
  380.                         case LA_Min:
  381.  
  382.                             Node->Min = TagItem->ti_Data;
  383.  
  384.                             break;
  385.  
  386.                         case LA_Max:
  387.  
  388.                             Node->Max = TagItem->ti_Data;
  389.  
  390.                             break;
  391.  
  392.                         case LABX_ReserveSpace:
  393.  
  394.                             if(Type == BOX_KIND)
  395.                                 Node->Special.Box.ReserveSpace = TagItem->ti_Data;
  396.  
  397.                             break;
  398.  
  399.                         case LA_Chars:
  400.  
  401.                             Node->Chars = TagItem->ti_Data;
  402.  
  403.                             break;
  404.  
  405.                         case LA_LabelPlace:
  406.  
  407.                             Node->LabelPlace = TagItem->ti_Data;
  408.  
  409.                             if(Type == MX_KIND)
  410.                             {
  411.                                 if(TagItem->ti_Data == PLACE_RIGHT)
  412.                                     Node->LabelPlace = PLACE_RIGHT;
  413.                                 else
  414.                                     Node->LabelPlace = PLACE_LEFT;
  415.                             }
  416.  
  417.                             break;
  418.  
  419.                         case LA_ExtraSpace:
  420.  
  421.                             Node->ExtraSpace = (WORD)TagItem->ti_Data;
  422.  
  423.                             if(Node->ExtraSpace == 1)
  424.                                 Node->ExtraSpace = 3;
  425.  
  426.                             break;
  427.  
  428.                         case LA_PageSelector:
  429.  
  430.                             Node->PageSelector = TagItem->ti_Data;
  431.                             break;
  432.  
  433.                         case LABT_ExtraFat:
  434.  
  435.                             if(Node->Type == BUTTON_KIND)
  436.                                 Node->Special.Button.ExtraFat = TagItem->ti_Data;
  437.  
  438.                             break;
  439.  
  440.                         case LABT_Smaller:
  441.  
  442.                             if(Node->Type == BUTTON_KIND)
  443.                                 Node->Special.Button.Smaller = TagItem->ti_Data;
  444.  
  445.                             break;
  446.  
  447.                         case LABT_DefaultCorrection:
  448.  
  449.                             if(Node->Type == BUTTON_KIND)
  450.                                 Node->Special.Button.DefaultCorrection = TagItem->ti_Data;
  451.  
  452.                             break;
  453.  
  454.                         case LABT_Lines:
  455.  
  456.                             if(Node->Type == BUTTON_KIND)
  457.                                 Node->Special.Button.Lines = (STRPTR *)TagItem->ti_Data;
  458.  
  459.                             break;
  460. #ifdef DO_PICKSHORTCUTS
  461.                         case LA_NoKey:
  462.  
  463.                             Node->NoKey = TagItem->ti_Data;
  464.                             break;
  465. #endif
  466.                         case LA_HighLabel:
  467.  
  468.                             Node->HighLabel = TagItem->ti_Data;
  469.                             break;
  470.  
  471.                         case LAPA_SmallPalette:
  472.  
  473.                             if(Type == PALETTE_KIND)
  474.                                 Node->Special.Palette.SmallPalette = TagItem->ti_Data;
  475.  
  476.                             break;
  477.  
  478.                         case LAPA_UsePicker:
  479.  
  480.                             if(Type == PALETTE_KIND)
  481.                                 Node->Special.Palette.UsePicker = TagItem->ti_Data;
  482.  
  483.                             break;
  484.  
  485.                         case LA_Lines:
  486.  
  487.                             if(Type == BOX_KIND)
  488.                             {
  489.                                 LONG Count = TagItem->ti_Data;
  490.  
  491.                                 if(Node->Lines != Count)
  492.                                 {
  493.                                     LTP_Free(Handle,Node->Special.Box.Lines,sizeof(STRPTR) * Node->Lines);
  494.  
  495.                                     Node->Special.Box.Lines = NULL;
  496.                                 }
  497.  
  498.                                 if(!Node->Special.Box.Lines)
  499.                                 {
  500.                                     if(Node->Special.Box.Lines = (STRPTR *)LTP_Alloc(Handle,sizeof(STRPTR) * Count))
  501.                                     {
  502.                                         LONG i;
  503.  
  504.                                         for(i = 0 ; i < Count ; i++)
  505.                                             Node->Special.Box.Lines[i] = "";
  506.                                     }
  507.                                 }
  508.                             }
  509.  
  510.                             Node->Lines = TagItem->ti_Data;
  511.  
  512.                             break;
  513.  
  514.                         case LA_Picker:
  515.  
  516.                             if(Type == TEXT_KIND)
  517.                                 Node->Special.Text.UsePicker = TagItem->ti_Data;
  518.  
  519.                             if(Type == STRING_KIND)
  520.                                 Node->Special.String.UsePicker = TagItem->ti_Data;
  521.  
  522.                             break;
  523.  
  524.                         case LACY_AutoPageID:
  525.  
  526.                             if(Type == CYCLE_KIND)
  527.                                 Node->Special.Cycle.AutoPageID = (LONG)TagItem->ti_Data;
  528.  
  529. #if defined(DO_POPUP_KIND) && defined(DO_BOOPSI_KIND)
  530.                             if(Type == POPUP_KIND)
  531.                                 Node->Special.Popup.AutoPageID = (LONG)TagItem->ti_Data;
  532. #endif
  533.  
  534. #if defined(DO_TAB_KIND) && defined(DO_BOOPSI_KIND)
  535.                             if(Type == TAB_KIND)
  536.                                 Node->Special.Tab.AutoPageID = (LONG)TagItem->ti_Data;
  537. #endif
  538.  
  539.                             if(Type == MX_KIND)
  540.                                 Node->Special.Radio.AutoPageID = (LONG)TagItem->ti_Data;
  541.  
  542.                             if(Type == LISTVIEW_KIND)
  543.                                 Node->Special.List.AutoPageID = (LONG)TagItem->ti_Data;
  544.  
  545.                             break;
  546.  
  547.                         case LAGR_Spread:
  548.  
  549.                             if(Type == GROUP_KIND)
  550.                                 Node->Special.Group.Spread = TagItem->ti_Data;
  551.  
  552.                             break;
  553.  
  554.                         case LAGR_FrameGroup:
  555.  
  556.                             if(Type == GROUP_KIND)
  557.                                 Node->Special.Group.FrameType = TagItem->ti_Data;
  558.  
  559.                             break;
  560. #ifdef NOT_FUNCTIONAL
  561.                         case LAGR_SameWidth:
  562.  
  563.                             if(Type == GROUP_KIND)
  564.                                 Node->Special.Group.UseWidth = TagItem->ti_Data;
  565.  
  566.                             break;
  567.  
  568.                         case LAGR_SameHeight:
  569.  
  570.                             if(Type == GROUP_KIND)
  571.                                 Node->Special.Group.UseHeight = TagItem->ti_Data;
  572.  
  573.                             break;
  574. #endif    // NOT_FUNCTIONAL
  575.                         case LAGR_NoIndent:
  576.  
  577.                             if(Type == GROUP_KIND)
  578.                                 Node->Special.Group.NoIndent = TagItem->ti_Data;
  579.  
  580.                             break;
  581.  
  582.                         case LAGR_IndentX:
  583.  
  584.                             if(Type == GROUP_KIND)
  585.                                 Node->Special.Group.IndentX = TagItem->ti_Data;
  586.  
  587.                             break;
  588.  
  589.                         case LAGR_IndentY:
  590.  
  591.                             if(Type == GROUP_KIND)
  592.                                 Node->Special.Group.IndentY = TagItem->ti_Data;
  593.  
  594.                             break;
  595.  
  596.                         case LAGR_Frame:
  597.  
  598.                             if(Type == GROUP_KIND)
  599.                                 Node->Special.Group.Frame = TagItem->ti_Data;
  600.  
  601.                             break;
  602.  
  603.                         case LAGR_SameSize:
  604.  
  605.                             if(Type == GROUP_KIND)
  606.                                 Node->Special.Group.SameSize = TagItem->ti_Data;
  607.  
  608.                             break;
  609.  
  610.                         case LAGR_LastAttributes:
  611.  
  612.                             if(Type == GROUP_KIND)
  613.                                 Node->Special.Group.LastAttributes = TagItem->ti_Data;
  614.  
  615.                             break;
  616.  
  617.                         case LAGR_ActivePage:
  618.  
  619.                             if(Type == GROUP_KIND)
  620.                             {
  621.                                 Node->Special.Group.ActivePage    = TagItem->ti_Data;
  622.                                 Node->Special.Group.Paging    = TRUE;
  623.                             }
  624.  
  625.                             break;
  626.  
  627.                         case LABT_ReturnKey:
  628.  
  629.                             if(Type == BUTTON_KIND)
  630.                                 Node->Special.Button.ReturnKey = TagItem->ti_Data;
  631.  
  632.                             break;
  633.  
  634.                         case LABT_EscKey:
  635.  
  636.                             if(Type == BUTTON_KIND)
  637.                                 Node->Special.Button.EscKey = TagItem->ti_Data;
  638.  
  639.                             break;
  640.  
  641.                         case LALV_CursorKey:
  642.  
  643.                             if(Type == LISTVIEW_KIND)
  644.                                 Node->Special.List.CursorKey = TagItem->ti_Data;
  645.  
  646.                             break;
  647.  
  648.                         case LALV_TextAttr:
  649.  
  650.                             if(Type == LISTVIEW_KIND)
  651.                                 Node->Special.List.TextAttr = (struct TextAttr *)TagItem->ti_Data;
  652.  
  653.                             break;
  654.  
  655.                         case LALV_LockSize:
  656.  
  657.                             if(Type == LISTVIEW_KIND)
  658.                                 Node->Special.List.LockSize = TagItem->ti_Data;
  659.  
  660.                             if(Type == TEXT_KIND)
  661.                                 Node->Special.Text.LockSize = TagItem->ti_Data;
  662.  
  663.                             break;
  664.  
  665.                         case LALV_MaxGrowX:
  666.  
  667.                             if(Type == LISTVIEW_KIND)
  668.                             {
  669.                                 Handle->GrowView = Node;
  670.  
  671.                                 Node->Special.List.MaxGrowX = TagItem->ti_Data;
  672.                             }
  673.  
  674.                             break;
  675.  
  676.                         case LALV_MaxGrowY:
  677.  
  678.                             if(Type == LISTVIEW_KIND)
  679.                             {
  680.                                 Handle->GrowView = Node;
  681.  
  682.                                 Node->Special.List.MaxGrowY = TagItem->ti_Data;
  683.                             }
  684.  
  685.                             break;
  686.  
  687.                         case LALV_ResizeX:
  688.  
  689.                             if(Type == LISTVIEW_KIND)
  690.                             {
  691.                                 Handle->ResizeView = Node;
  692.  
  693.                                 Handle->IDCMP |= IDCMP_SIZEVERIFY | IDCMP_NEWSIZE;
  694.  
  695.                                 Node->Special.List.ResizeX = TagItem->ti_Data;
  696.                             }
  697.  
  698.                             break;
  699.  
  700.                         case LALV_ResizeY:
  701.  
  702.                             if(Type == LISTVIEW_KIND)
  703.                             {
  704.                                 Handle->ResizeView = Node;
  705.  
  706.                                 Handle->IDCMP |= IDCMP_SIZEVERIFY | IDCMP_NEWSIZE;
  707.  
  708.                                 Node->Special.List.ResizeY = TagItem->ti_Data;
  709.                             }
  710.  
  711.                             break;
  712.  
  713.                         case LALV_MinChars:
  714.  
  715.                             if(Type == LISTVIEW_KIND)
  716.                                 Node->Special.List.MinChars = TagItem->ti_Data;
  717.  
  718.                             break;
  719.  
  720.                         case LALV_MinLines:
  721.  
  722.                             if(Type == LISTVIEW_KIND)
  723.                                 Node->Special.List.MinLines = TagItem->ti_Data;
  724.  
  725.                             break;
  726.  
  727.                         case LALV_FlushLabelLeft:
  728.  
  729.                             if(Type == LISTVIEW_KIND)
  730.                                 Node->Special.List.FlushLabelLeft = TagItem->ti_Data;
  731.  
  732.                             break;
  733.  
  734.                         case LALV_Labels:
  735.  
  736.                             if(Type == LISTVIEW_KIND)
  737.                             {
  738.                                 STRPTR *Labels = (STRPTR *)TagItem->ti_Data;
  739.  
  740.                                 if(*Labels)
  741.                                 {
  742.                                     struct List *SomeList;
  743.  
  744.                                     if(SomeList = LTP_Alloc(Handle,sizeof(struct List)))
  745.                                     {
  746.                                         struct Node *SomeNode;
  747.  
  748.                                         NewList(SomeList);
  749.  
  750.                                         Node->Special.List.Labels = SomeList;
  751.  
  752.                                         while(*Labels)
  753.                                         {
  754.                                             if(SomeNode = LTP_Alloc(Handle,sizeof(struct Node) + strlen(*Labels) + 1))
  755.                                             {
  756.                                                 SomeNode->ln_Name = (STRPTR)(SomeNode + 1);
  757.  
  758.                                                 strcpy(SomeNode->ln_Name,*Labels++);
  759.  
  760.                                                 AddTail(SomeList,SomeNode);
  761.                                             }
  762.                                         }
  763.                                     }
  764.                                 }
  765.                             }
  766.  
  767.                             break;
  768.  
  769.                         case LA_Link:
  770.  
  771.                             if(Type == LISTVIEW_KIND)
  772.                                 Node->Special.List.LinkID = TagItem->ti_Data;
  773.  
  774.                             if(Type == STRING_KIND)
  775.                                 Node->Special.String.LinkID = TagItem->ti_Data;
  776.  
  777.                             if(Type == BOOPSI_KIND)
  778.                                 Node->Special.BOOPSI.Link = (LONG)TagItem->ti_Data;
  779.  
  780.                             break;
  781.  
  782. #ifdef DO_TAPEDECK_KIND
  783.                         case LATD_ButtonType:
  784.  
  785.                             if(Type == TAPEDECK_KIND)
  786.                                 Node->Special.TapeDeck.ButtonType = TagItem->ti_Data;
  787.  
  788.                             break;
  789.  
  790.                         case LATD_Toggle:
  791.  
  792.                             if(Type == TAPEDECK_KIND)
  793.                                 Node->Special.TapeDeck.Toggle = TagItem->ti_Data;
  794.  
  795.                             break;
  796.  
  797.                         case LATD_Pressed:
  798.  
  799.                             if(Type == TAPEDECK_KIND)
  800.                                 Node->Current = TagItem->ti_Data;
  801.  
  802.                             break;
  803.  
  804.                         case LATD_Tick:
  805.  
  806.                             if(Type == TAPEDECK_KIND)
  807.                                 Node->Special.TapeDeck.Tick = TagItem->ti_Data;
  808.  
  809.                             break;
  810.  
  811.                         case LATD_Smaller:
  812.  
  813.                             if(Type == TAPEDECK_KIND)
  814.                                 Node->Special.TapeDeck.Smaller = TagItem->ti_Data;
  815.  
  816.                             break;
  817. #endif    /* DO_TAPEDECK_KIND */
  818.  
  819. #ifdef DO_GAUGE_KIND
  820.                         case LAGA_Percent:
  821.  
  822.                             if(Type == GAUGE_KIND)
  823.                             {
  824.                                 LONG Percent = (LONG)TagItem->ti_Data;
  825.  
  826.                                 if(Percent <= 0)
  827.                                     Node->Current = 0;
  828.                                 else
  829.                                 {
  830.                                     if(Percent > 100)
  831.                                         Node->Current = 100;
  832.                                     else
  833.                                         Node->Current = Percent;
  834.                                 }
  835.                             }
  836.  
  837.                             break;
  838.  
  839.                         case LAGA_NoTicks:
  840.  
  841.                             if(Type == GAUGE_KIND)
  842.                                 Node->Special.Gauge.NoTicks = TagItem->ti_Data;
  843.  
  844.                             break;
  845.  
  846.                         case LAGA_Discrete:
  847.  
  848.                             if(Type == GAUGE_KIND)
  849.                                 Node->Special.Gauge.Discrete = TagItem->ti_Data;
  850.  
  851.                             break;
  852.  
  853.                         case LAGA_InfoLength:
  854.  
  855.                             if(Type == GAUGE_KIND)
  856.                             {
  857.                                 LONG Length = (LONG)TagItem->ti_Data;
  858.  
  859.                                 if(Length > Node->Special.Gauge.InfoLength)
  860.                                 {
  861.                                     STRPTR NewText;
  862.  
  863.                                     if(NewText = (STRPTR)LTP_Alloc(Handle,Length + 1))
  864.                                     {
  865.                                         if(Node->Special.Gauge.InfoText)
  866.                                         {
  867.                                             strcpy(NewText,Node->Special.Gauge.InfoText);
  868.  
  869.                                             LTP_Free(Handle,Node->Special.Gauge.InfoText,Node->Special.Gauge.InfoLength + 1);
  870.                                         }
  871.  
  872.                                         NewText[0] = 0;
  873.  
  874.                                         Node->Special.Gauge.InfoText    = NewText;
  875.                                         Node->Special.Gauge.InfoLength    = Length;
  876.                                     }
  877.                                 }
  878.                             }
  879.  
  880.                             break;
  881.  
  882.                         case LAGA_InfoText:
  883.  
  884.                             if(Type == GAUGE_KIND)
  885.                             {
  886.                                 STRPTR    SomeText    = (STRPTR)TagItem->ti_Data;
  887.                                 LONG    Len            = strlen(SomeText);
  888.  
  889.                                 if(!Node->Special.Gauge.InfoLength)
  890.                                 {
  891.                                     if(Node->Special.Gauge.InfoText = (STRPTR)LTP_Alloc(Handle,Len + 1))
  892.                                         Node->Special.Gauge.InfoLength = Len;
  893.                                 }
  894.  
  895.                                 if(Node->Special.Gauge.InfoLength)
  896.                                 {
  897.                                     if(Len > Node->Special.Gauge.InfoLength)
  898.                                         Len = Node->Special.Gauge.InfoLength;
  899.  
  900.                                     CopyMem(SomeText,Node->Special.Gauge.InfoText,Len);
  901.  
  902.                                     Node->Special.Gauge.InfoText[Len] = 0;
  903.                                 }
  904.                             }
  905.  
  906.                             break;
  907. #endif
  908.                         case LALV_ExtraLabels:
  909.  
  910.                             if(Type == LISTVIEW_KIND)
  911.                                 Node->Special.List.ExtraLabels = (STRPTR *)TagItem->ti_Data;
  912.  
  913.                             break;
  914.  
  915.                         case LACY_TabKey:
  916.  
  917.                             if(Type == CYCLE_KIND)
  918.                                 Node->Special.Cycle.TabKey = TagItem->ti_Data;
  919.  
  920. #if defined(DO_POPUP_KIND) && defined(DO_BOOPSI_KIND)
  921.                             if(Type == POPUP_KIND)
  922.                                 Node->Special.Popup.TabKey = TagItem->ti_Data;
  923. #endif
  924.  
  925. #if defined(DO_TAB_KIND) && defined(DO_TAB_KIND)
  926.                             if(Type == TAB_KIND)
  927.                                 Node->Special.Tab.TabKey = TagItem->ti_Data;
  928. #endif
  929.  
  930.                             if(Type == MX_KIND)
  931.                                 Node->Special.Radio.TabKey = TagItem->ti_Data;
  932.  
  933.                             break;
  934.  
  935. #if defined(DO_TAB_KIND) && defined(DO_TAB_KIND)
  936.                         case LATB_FullWidth:
  937.  
  938.                             if(Type == TAB_KIND)
  939.                                 Node->Special.Tab.FullWidth = TagItem->ti_Data;
  940.  
  941.                             break;
  942. #endif
  943.  
  944. #ifdef DO_BOOPSI_KIND
  945.                         case LABO_FullWidth:
  946.  
  947.                             if(Type == BOOPSI_KIND)
  948.                                 Node->Special.BOOPSI.FullWidth = (WORD)TagItem->ti_Data;
  949.  
  950.                             break;
  951.  
  952.                         case LABO_ActivateHook:
  953.  
  954.                             if(Type == BOOPSI_KIND)
  955.                                 Node->Special.BOOPSI.ActivateHook = (struct Hook *)TagItem->ti_Data;
  956.  
  957.                             break;
  958.  
  959.                         case LABO_FullHeight:
  960.  
  961.                             if(Type == BOOPSI_KIND)
  962.                                 Node->Special.BOOPSI.FullHeight = (WORD)TagItem->ti_Data;
  963.  
  964.                             break;
  965.  
  966.                         case LABO_RelFontHeight:
  967.  
  968.                             if(Type == BOOPSI_KIND)
  969.                                 Node->Special.BOOPSI.RelFontHeight = (WORD)TagItem->ti_Data;
  970.  
  971.                             break;
  972.  
  973.                         case LABO_TagScreen:
  974.  
  975.                             if(Type == BOOPSI_KIND)
  976.                                 Node->Special.BOOPSI.TagScreen = TagItem->ti_Data;
  977.  
  978.                             break;
  979.  
  980.                         case LABO_TagCurrent:
  981.  
  982.                             if(Type == BOOPSI_KIND)
  983.                                 Node->Special.BOOPSI.TagCurrent = TagItem->ti_Data;
  984.  
  985.                             break;
  986.  
  987.                         case LABO_TagLink:
  988.  
  989.                             if(Type == BOOPSI_KIND)
  990.                                 Node->Special.BOOPSI.TagLink = TagItem->ti_Data;
  991.  
  992.                             break;
  993.  
  994.                         case LABO_ExactWidth:
  995.  
  996.                             if(Type == BOOPSI_KIND)
  997.                                 Node->Special.BOOPSI.ExactWidth = TagItem->ti_Data;
  998.  
  999.                             break;
  1000.  
  1001.                         case LABO_ExactHeight:
  1002.  
  1003.                             if(Type == BOOPSI_KIND)
  1004.                                 Node->Special.BOOPSI.ExactHeight = TagItem->ti_Data;
  1005.  
  1006.                             break;
  1007.  
  1008.                         case LABO_TagTextAttr:
  1009.  
  1010.                             if(Type == BOOPSI_KIND)
  1011.                                 Node->Special.BOOPSI.TagTextAttr = TagItem->ti_Data;
  1012.  
  1013.                             break;
  1014.  
  1015.                         case LABO_TagDrawInfo:
  1016.  
  1017.                             if(Type == BOOPSI_KIND)
  1018.                                 Node->Special.BOOPSI.TagDrawInfo = TagItem->ti_Data;
  1019.  
  1020.                             break;
  1021.  
  1022.                         case LABO_ClassInstance:
  1023.  
  1024.                             if(Type == BOOPSI_KIND)
  1025.                                 Node->Special.BOOPSI.ClassInstance = (Class *)TagItem->ti_Data;
  1026.  
  1027.                             break;
  1028.  
  1029.                         case LABO_ClassName:
  1030.  
  1031.                             if(Type == BOOPSI_KIND)
  1032.                                 Node->Special.BOOPSI.ClassName = (STRPTR)TagItem->ti_Data;
  1033.  
  1034.                             break;
  1035.  
  1036.                         case LABO_ClassLibraryName:
  1037.  
  1038.                             if(Type == BOOPSI_KIND)
  1039.                                 Node->Special.BOOPSI.ClassLibraryName = (STRPTR)TagItem->ti_Data;
  1040.  
  1041.                             break;
  1042. #endif    /* DO_BOOPSI_KIND */
  1043.  
  1044.                         case LAFR_RefreshHook:
  1045.  
  1046.                             if(Type == FRAME_KIND)
  1047.                                 Node->Special.Frame.RefreshHook = (struct Hook *)TagItem->ti_Data;
  1048.  
  1049.                             break;
  1050.  
  1051.                         case LAFR_InnerWidth:
  1052.  
  1053.                             if(Type == FRAME_KIND)
  1054.                                 Node->Special.Frame.InnerWidth = TagItem->ti_Data;
  1055.  
  1056.                             break;
  1057.  
  1058.                         case LAFR_InnerHeight:
  1059.  
  1060.                             if(Type == FRAME_KIND)
  1061.                                 Node->Special.Frame.InnerHeight = TagItem->ti_Data;
  1062.  
  1063.                             break;
  1064.  
  1065.                         case LA_DrawBox:
  1066.  
  1067.                             if(Type == FRAME_KIND)
  1068.                                 Node->Special.Frame.DrawBox = TagItem->ti_Data;
  1069.  
  1070.                             if(Type == BOX_KIND)
  1071.                                 Node->Special.Box.DrawBox = TagItem->ti_Data;
  1072.  
  1073.                             break;
  1074.  
  1075.                         case LAFR_GenerateEvents:
  1076.  
  1077.                             if(Type == FRAME_KIND)
  1078.                                 Node->Special.Frame.GenerateEvents = TagItem->ti_Data;
  1079.  
  1080.                             break;
  1081.  
  1082.                         case LABX_AlignText:
  1083.  
  1084.                             if(Type == BOX_KIND)
  1085.                                 Node->Special.Box.AlignText = TagItem->ti_Data;
  1086.  
  1087.                             break;
  1088.  
  1089.                         case LABX_Line:
  1090.  
  1091.                             if(Type == BOX_KIND)
  1092.                                 BoxLine = (STRPTR)TagItem->ti_Data;
  1093.  
  1094.                             break;
  1095.  
  1096.                         case LABX_LineID:
  1097.  
  1098.                             if(Type == BOX_KIND)
  1099.                             {
  1100.                                 if(Handle->LocaleHook)
  1101.                                     BoxLine = (STRPTR)CallHookPkt(Handle->LocaleHook,Handle,(APTR)TagItem->ti_Data);
  1102.                                 else
  1103.                                     Handle->Failed = TRUE;
  1104.                             }
  1105.  
  1106.                             break;
  1107.  
  1108.                         case LABX_Labels:
  1109.  
  1110.                             if(Type == BOX_KIND)
  1111.                             {
  1112.                                 STRPTR    *Labels = (STRPTR *)TagItem->ti_Data;
  1113.                                 LONG     Count    = 0;
  1114.  
  1115.                                 while(Labels[Count])
  1116.                                     Count++;
  1117.  
  1118.                                 if(Node->Lines != Count)
  1119.                                 {
  1120.                                     LTP_Free(Handle,Node->Special.Box.Lines,sizeof(STRPTR) * Node->Lines);
  1121.  
  1122.                                     Node->Special.Box.Lines = NULL;
  1123.                                 }
  1124.  
  1125.                                 if(Count)
  1126.                                 {
  1127.                                     if(!Node->Special.Box.Lines)
  1128.                                     {
  1129.                                         if(Node->Special.Box.Lines = LTP_Alloc(Handle,sizeof(STRPTR) * Count))
  1130.                                         {
  1131.                                             LONG i;
  1132.  
  1133.                                             for(i = 0 ; i < Count ; i++)
  1134.                                                 Node->Special.Box.Lines[i] = "";
  1135.                                         }
  1136.                                     }
  1137.                                 }
  1138.  
  1139.                                 Node->Lines = Count;
  1140.  
  1141.                                 Node->Special.Box.Labels = Labels;
  1142.                             }
  1143.  
  1144.                             break;
  1145.  
  1146.                         case LABX_Lines:
  1147.  
  1148.                             if(Type == BOX_KIND)
  1149.                             {
  1150.                                 STRPTR    *Lines = (STRPTR *)TagItem->ti_Data;
  1151.                                 LONG     Count = 0;
  1152.  
  1153.                                 while(Lines[Count])
  1154.                                     Count++;
  1155.  
  1156.                                 if(Node->Lines && Count > Node->Lines)
  1157.                                     Count = Node->Lines;
  1158.  
  1159.                                 if(Count)
  1160.                                 {
  1161.                                     if(!Node->Special.Box.Lines)
  1162.                                         Node->Special.Box.Lines = LTP_Alloc(Handle,sizeof(STRPTR) * Count);
  1163.  
  1164.                                     if(Node->Special.Box.Lines)
  1165.                                     {
  1166.                                         LONG i;
  1167.  
  1168.                                         for(i = 0 ; i < Count ; i++)
  1169.                                             Node->Special.Box.Lines[i] = Lines[i];
  1170.                                     }
  1171.                                 }
  1172.  
  1173.                                 Node->Lines = Count;
  1174.                             }
  1175.  
  1176.                             break;
  1177.  
  1178.                         case LABX_LineTable:
  1179.  
  1180.                             if(Type == BOX_KIND)
  1181.                                 LineTable = (LONG *)TagItem->ti_Data;
  1182.  
  1183.                             break;
  1184.  
  1185.                         case LABX_FirstLine:
  1186.  
  1187.                             if(Type == BOX_KIND)
  1188.                                 FirstLine = TagItem->ti_Data;
  1189.  
  1190.                             break;
  1191.  
  1192.                         case LABX_LastLine:
  1193.  
  1194.                             if(Type == BOX_KIND)
  1195.                                 LastLine = TagItem->ti_Data;
  1196.  
  1197.                             break;
  1198.  
  1199.                         case GA_Disabled:
  1200.  
  1201.                             Node->Disabled = TagItem->ti_Data;
  1202.                             break;
  1203.  
  1204.                         case GTCB_Checked:
  1205.  
  1206.                             if(Type == CHECKBOX_KIND)
  1207.                                 Node->Current = TagItem->ti_Data;
  1208.  
  1209.                             break;
  1210.  
  1211.                         case GTLV_Labels:
  1212.  
  1213.                             if(Type == LISTVIEW_KIND)
  1214.                             {
  1215.                                 if(TagItem->ti_Data)
  1216.                                     Node->Special.List.Labels = (struct List *)TagItem->ti_Data;
  1217.                                 else
  1218.                                     Node->Special.List.Labels = (struct List *)<P_EmptyList;
  1219.                             }
  1220.  
  1221.                             break;
  1222.  
  1223.                         case GTLV_ReadOnly:
  1224.  
  1225.                             if(Type == LISTVIEW_KIND)
  1226.                                 Node->Special.List.ReadOnly = TagItem->ti_Data;
  1227.  
  1228.                             break;
  1229.  
  1230.                         case GTLV_Selected:
  1231.                         case LALV_Selected:
  1232.  
  1233.                             if(Type == LISTVIEW_KIND)
  1234.                                 Node->Current = (LONG)TagItem->ti_Data;
  1235.  
  1236.                             break;
  1237.  
  1238.                         case GTLV_CallBack:
  1239.  
  1240.                             if(Type == LISTVIEW_KIND)
  1241.                                 Node->Special.List.CallBack = (struct Hook *)TagItem->ti_Data;
  1242.  
  1243.                             break;
  1244.  
  1245.                         case GTLV_MaxPen:
  1246.  
  1247.                             if(Type == LISTVIEW_KIND)
  1248.                                 Node->Special.List.MaxPen = TagItem->ti_Data;
  1249.  
  1250.                             break;
  1251.  
  1252.                         case GTMX_Labels:
  1253.  
  1254.                             if(Type == MX_KIND)
  1255.                                 Node->Special.Radio.Choices = (STRPTR *)TagItem->ti_Data;
  1256.  
  1257.                             break;
  1258.  
  1259.                         case GTMX_Active:
  1260.  
  1261.                             if(Type == MX_KIND)
  1262.                                 Node->Current = TagItem->ti_Data;
  1263.  
  1264.                             break;
  1265.  
  1266.                         case GTMX_TitlePlace:
  1267.  
  1268.                             if(Type == MX_KIND && Label)
  1269.                             {
  1270.                                 if(TagItem->ti_Data == PLACE_RIGHT)
  1271.                                     Node->Special.Radio.TitlePlace = PLACETEXT_RIGHT;
  1272.                                 else
  1273.                                     Node->Special.Radio.TitlePlace = PLACETEXT_LEFT;
  1274.                             }
  1275.  
  1276.                             break;
  1277.  
  1278.                         case GTTX_Text:
  1279.  
  1280.                             if(Type == TEXT_KIND)
  1281.                                 Node->Special.Text.Text = (STRPTR)TagItem->ti_Data;
  1282.  
  1283.                             break;
  1284.  
  1285.                         case GTTX_FrontPen:
  1286.  
  1287.                             if(Type == TEXT_KIND)
  1288.                                 Node->Special.Text.FrontPen = (WORD)TagItem->ti_Data;
  1289.  
  1290.                             if(Type == NUMBER_KIND)
  1291.                                 Node->Special.Number.FrontPen = (WORD)TagItem->ti_Data;
  1292.  
  1293.                             break;
  1294.  
  1295.                         case GTTX_BackPen:
  1296.  
  1297.                             if(Type == TEXT_KIND)
  1298.                                 Node->Special.Text.BackPen = (WORD)TagItem->ti_Data;
  1299.  
  1300.                             if(Type == NUMBER_KIND)
  1301.                                 Node->Special.Number.BackPen = (WORD)TagItem->ti_Data;
  1302.  
  1303.                             break;
  1304.  
  1305.                         case GTTX_CopyText:
  1306.  
  1307.                             if(Type == TEXT_KIND)
  1308.                                 Node->Special.Text.CopyText = TagItem->ti_Data;
  1309.  
  1310.                             break;
  1311.  
  1312.                         case GTTX_Border:
  1313.  
  1314.                             if(Type == TEXT_KIND)
  1315.                                 Node->Special.Text.Border = TagItem->ti_Data;
  1316.  
  1317.                             break;
  1318.  
  1319.                         case GTNM_Number:
  1320.  
  1321.                             if(Type == NUMBER_KIND)
  1322.                                 Node->Special.Number.Number = TagItem->ti_Data;
  1323.  
  1324.                             break;
  1325.  
  1326.                         case GTNM_MaxNumberLen:
  1327.  
  1328.                             if(Type == NUMBER_KIND)
  1329.                                 Node->Special.Number.MaxNumberLen = TagItem->ti_Data;
  1330.  
  1331.                             break;
  1332.  
  1333.                         case GTNM_Format:
  1334.  
  1335.                             if(Type == NUMBER_KIND)
  1336.                                 Node->Special.Number.Format = (STRPTR)TagItem->ti_Data;
  1337.  
  1338.                             break;
  1339.  
  1340.                         case GTNM_Border:
  1341.  
  1342.                             if(Type == NUMBER_KIND)
  1343.                                 Node->Special.Number.Border = TagItem->ti_Data;
  1344.  
  1345.                             break;
  1346.  
  1347.                         case GTTX_Justification:
  1348.  
  1349.                             if(Type == NUMBER_KIND)
  1350.                                 Node->Special.Number.Justification = TagItem->ti_Data;
  1351.  
  1352.                             if(Type == TEXT_KIND)
  1353.                                 Node->Special.Text.Justification = TagItem->ti_Data;
  1354.  
  1355.                             break;
  1356.  
  1357.                         case LAPU_CentreActive:
  1358.  
  1359.                             if(Type == POPUP_KIND)
  1360.                                 Node->Special.Popup.CentreActive = TagItem->ti_Data;
  1361.  
  1362.                             break;
  1363.  
  1364.                         case GTCY_Labels:
  1365.  
  1366.                             if(Type == CYCLE_KIND)
  1367.                                 Node->Special.Cycle.Choices = (STRPTR *)TagItem->ti_Data;
  1368.  
  1369. #if defined(DO_POPUP_KIND) && defined(DO_BOOPSI_KIND)
  1370.                             if(Type == POPUP_KIND)
  1371.                                 Node->Special.Popup.Choices = (STRPTR *)TagItem->ti_Data;
  1372. #endif
  1373.  
  1374. #if defined(DO_TAB_KIND) && defined(DO_BOOPSI_KIND)
  1375.                             if(Type == TAB_KIND)
  1376.                                 Node->Special.Tab.Choices = (STRPTR *)TagItem->ti_Data;
  1377. #endif
  1378.  
  1379.                             break;
  1380.  
  1381.                         case GTCY_Active:
  1382.  
  1383.                             if(Type == CYCLE_KIND)
  1384.                                 Node->Current = TagItem->ti_Data;
  1385.  
  1386. #if defined(DO_POPUP_KIND) && defined(DO_BOOPSI_KIND)
  1387.                             if(Type == POPUP_KIND)
  1388.                                 Node->Current = TagItem->ti_Data;
  1389. #endif
  1390.  
  1391. #if defined(DO_TAB_KIND) && defined(DO_BOOPSI_KIND)
  1392.                             if(Type == TAB_KIND)
  1393.                                 Node->Current = TagItem->ti_Data;
  1394. #endif
  1395.  
  1396.                             break;
  1397.  
  1398.                         case GTPA_Depth:
  1399.  
  1400.                             if(Type == PALETTE_KIND)
  1401.                             {
  1402.                                 Node->Special.Palette.Depth = TagItem->ti_Data;
  1403.  
  1404.                                 if(Handle->MaxPen < (1L << Node->Special.Palette.Depth) - 1)
  1405.                                     Handle->MaxPen = (1L << Node->Special.Palette.Depth) - 1;
  1406.                             }
  1407.  
  1408.                             break;
  1409.  
  1410.                         case GTPA_Color:
  1411.  
  1412.                             if(Type == PALETTE_KIND)
  1413.                                 Node->Current = TagItem->ti_Data;
  1414.  
  1415.                             break;
  1416.  
  1417.                         case GTPA_ColorOffset:
  1418.  
  1419.                             if(Type == PALETTE_KIND)
  1420.                                 Node->Min = TagItem->ti_Data;
  1421.  
  1422.                             break;
  1423.  
  1424.                         case GTPA_NumColors:
  1425.  
  1426.                             if(Type == PALETTE_KIND)
  1427.                             {
  1428.                                 Node->Special.Palette.NumColours = TagItem->ti_Data;
  1429.  
  1430.                                 if(Node->Special.Palette.ColourTable)
  1431.                                 {
  1432.                                     LONG i;
  1433.  
  1434.                                     for(i = 0 ; i < Node->Special.Palette.NumColours ; i++)
  1435.                                     {
  1436.                                         if(Node->Special.Palette.ColourTable[i] > Handle->MaxPen)
  1437.                                             Handle->MaxPen = Node->Special.Palette.ColourTable[i];
  1438.                                     }
  1439.                                 }
  1440.                             }
  1441.  
  1442.                             break;
  1443.  
  1444.                         case GTPA_ColorTable:
  1445.  
  1446.                             if(Type == PALETTE_KIND)
  1447.                             {
  1448.                                 Node->Special.Palette.ColourTable = (UBYTE *)TagItem->ti_Data;
  1449.  
  1450.                                 if(Node->Special.Palette.NumColours)
  1451.                                 {
  1452.                                     LONG i;
  1453.  
  1454.                                     for(i = 0 ; i < Node->Special.Palette.NumColours ; i++)
  1455.                                     {
  1456.                                         if(Node->Special.Palette.ColourTable[i] > Handle->MaxPen)
  1457.                                             Handle->MaxPen = Node->Special.Palette.ColourTable[i];
  1458.                                     }
  1459.                                 }
  1460.                             }
  1461.  
  1462.                             break;
  1463.  
  1464.                         case GA_RelVerify:
  1465.  
  1466.                             if(Type == SCROLLER_KIND)
  1467.                                 Node->Special.Scroller.RelVerify = TagItem->ti_Data;
  1468.  
  1469.                             break;
  1470.  
  1471.                         case GA_Immediate:
  1472.  
  1473.                             if(Type == SCROLLER_KIND)
  1474.                                 Node->Special.Scroller.Immediate = TagItem->ti_Data;
  1475.  
  1476.                             break;
  1477.  
  1478.                         case GTSC_Top:
  1479.  
  1480.                             if(Type == SCROLLER_KIND)
  1481.                                 Node->Current = TagItem->ti_Data;
  1482.  
  1483.                             break;
  1484.  
  1485.                         case GTSC_Total:
  1486.  
  1487.                             if(Type == SCROLLER_KIND)
  1488.                                 Node->Max = TagItem->ti_Data;
  1489.  
  1490.                             break;
  1491.  
  1492.                         case GTSC_Visible:
  1493.  
  1494.                             if(Type == SCROLLER_KIND)
  1495.                                 Node->Special.Scroller.Visible = TagItem->ti_Data;
  1496.  
  1497.                             break;
  1498.  
  1499.                         case GTSC_Arrows:
  1500.  
  1501.                             if(Type == SCROLLER_KIND)
  1502.                                 Node->Special.Scroller.Arrows = (TagItem->ti_Data != 0);
  1503.  
  1504.                             break;
  1505.  
  1506.                         case LASC_Thin:
  1507.  
  1508.                             if(Type == SCROLLER_KIND)
  1509.                                 Node->Special.Scroller.Thin = TagItem->ti_Data;
  1510.  
  1511.                             break;
  1512.  
  1513.                         case PGA_Freedom:
  1514.  
  1515.                             if(Type == SCROLLER_KIND)
  1516.                                 Node->Special.Scroller.Vertical = (TagItem->ti_Data == LORIENT_VERT);
  1517.  
  1518.                             break;
  1519.  
  1520.                         case GTSL_Min:
  1521.  
  1522.                             if(Type == SLIDER_KIND || Type == LEVEL_KIND)
  1523.                                 Node->Min = TagItem->ti_Data;
  1524.  
  1525.                             break;
  1526.  
  1527.                         case GTSL_Max:
  1528.  
  1529.                             if(Type == SLIDER_KIND || Type == LEVEL_KIND)
  1530.                                 Node->Max = TagItem->ti_Data;
  1531.  
  1532.                             break;
  1533.  
  1534.                         case GTSL_Level:
  1535.  
  1536.                             if(Type == SLIDER_KIND || Type == LEVEL_KIND)
  1537.                                 Node->Current = TagItem->ti_Data;
  1538.  
  1539.                             break;
  1540.  
  1541.                         case GTSL_LevelFormat:
  1542.  
  1543. #ifdef DO_LEVEL_KIND
  1544.                             if(Type == LEVEL_KIND)
  1545.                                 Node->Special.Level.LevelFormat = (STRPTR)TagItem->ti_Data;
  1546. #endif    /* DO_LEVEL_KIND */
  1547.  
  1548.                             if(Type == SLIDER_KIND)
  1549.                                 Node->Special.Slider.LevelFormat = (STRPTR)TagItem->ti_Data;
  1550.  
  1551.                             break;
  1552.  
  1553.                         case GTSL_LevelPlace:
  1554.  
  1555. #ifdef DO_LEVEL_KIND
  1556.                             if(Type == LEVEL_KIND)
  1557.                             {
  1558.                                 if(TagItem->ti_Data == PLACE_RIGHT)
  1559.                                     Node->Special.Level.LevelPlace = PLACETEXT_RIGHT;
  1560.                                 else
  1561.                                     Node->Special.Level.LevelPlace = PLACETEXT_LEFT;
  1562.                             }
  1563. #endif    /* DO_LEVEL_KIND */
  1564.  
  1565.                             if(Type == SLIDER_KIND)
  1566.                             {
  1567.                                 if(TagItem->ti_Data == PLACE_RIGHT)
  1568.                                     Node->Special.Slider.LevelPlace = PLACETEXT_RIGHT;
  1569.                                 else
  1570.                                     Node->Special.Slider.LevelPlace = PLACETEXT_LEFT;
  1571.                             }
  1572.  
  1573.                             break;
  1574.  
  1575.                         case GTSL_DispFunc:
  1576.  
  1577. #ifdef DO_LEVEL_KIND
  1578.                             if(Type == LEVEL_KIND)
  1579.                                 Node->Special.Level.DispFunc = (DISPFUNC)TagItem->ti_Data;
  1580. #endif    /* DO_LEVEL_KIND */
  1581.  
  1582.                             if(Type == SLIDER_KIND)
  1583.                                 Node->Special.Slider.DispFunc = (DISPFUNC)TagItem->ti_Data;
  1584.  
  1585.                             break;
  1586.  
  1587.                         case LASL_FullCheck:
  1588.  
  1589.                             if(Type == SLIDER_KIND)
  1590.                                 Node->Special.Slider.FullLevelCheck = TagItem->ti_Data;
  1591.  
  1592. #ifdef DO_LEVEL_KIND
  1593.                             if(Type == LEVEL_KIND)
  1594.                                 Node->Special.Level.FullLevelCheck = TagItem->ti_Data;
  1595. #endif    /* DO_LEVEL_KIND */
  1596.  
  1597.                             break;
  1598.  
  1599.                         case GTST_String:
  1600.  
  1601.                             if(Type == STRING_KIND || Type == PASSWORD_KIND || Type == FRACTION_KIND)
  1602.                                 Node->Special.String.String = (STRPTR)TagItem->ti_Data;
  1603.  
  1604.                             break;
  1605.  
  1606.                         case LAST_Activate:
  1607.  
  1608.                             if(Type == STRING_KIND || Type == PASSWORD_KIND || Type == FRACTION_KIND)
  1609.                                 Node->Special.String.Activate = TagItem->ti_Data;
  1610.  
  1611.                             if(Type == INTEGER_KIND)
  1612.                                 Node->Special.Integer.Activate = TagItem->ti_Data;
  1613.  
  1614.                             break;
  1615.  
  1616.                         case GTST_MaxChars:
  1617.  
  1618.                             if(Type == STRING_KIND || Type == PASSWORD_KIND || Type == FRACTION_KIND)
  1619.                                 Node->Special.String.MaxChars = TagItem->ti_Data;
  1620.  
  1621.                             break;
  1622.  
  1623.                         case GTST_EditHook:
  1624.  
  1625.                             if(Type == STRING_KIND)
  1626.                                 Node->Special.String.EditHook = (struct Hook *)TagItem->ti_Data;
  1627.                             else
  1628.                             {
  1629.                                 if(Type == INTEGER_KIND)
  1630.                                 {
  1631.                                     if(Node->Special.Integer.EditHook = (struct Hook *)TagItem->ti_Data)
  1632.                                         Node->Special.Integer.CustomHook = TRUE;
  1633.                                 }
  1634.                             }
  1635.  
  1636.                             break;
  1637.  
  1638.                         case LAST_ValidateHook:
  1639.  
  1640.                             if(Type == STRING_KIND || Type == PASSWORD_KIND || Type == FRACTION_KIND)
  1641.                                 Node->Special.String.ValidateHook = (struct Hook *)TagItem->ti_Data;
  1642.                             else
  1643.                             {
  1644.                                 if(Type == INTEGER_KIND)
  1645.                                     Node->Special.Integer.ValidateHook = (struct Hook *)TagItem->ti_Data;
  1646.                             }
  1647.  
  1648.                             break;
  1649.  
  1650.                         case STRINGA_Justification:
  1651.  
  1652.                             if(Type == STRING_KIND || Type == PASSWORD_KIND || Type == FRACTION_KIND)
  1653.                                 Node->Special.String.Justification = TagItem->ti_Data;
  1654.                             else
  1655.                             {
  1656.                                 if(Type == INTEGER_KIND)
  1657.                                     Node->Special.Integer.Justification = TagItem->ti_Data;
  1658.                             }
  1659.  
  1660.                             break;
  1661.  
  1662.                         case LAIN_UseIncrementers:
  1663.  
  1664.                             if(Type == INTEGER_KIND)
  1665.                             {
  1666.                                 if(Node->Special.Integer.UseIncrementers = TagItem->ti_Data)
  1667.                                     Handle->IDCMP |= IDCMP_INTUITICKS;
  1668.                             }
  1669.  
  1670.                             break;
  1671.  
  1672.                         case GTIN_Number:
  1673.  
  1674.                             if(Type == INTEGER_KIND)
  1675.                                 Node->Special.Integer.Number = TagItem->ti_Data;
  1676.  
  1677.                             break;
  1678.  
  1679.                         case GTIN_MaxChars:
  1680.  
  1681.                             if(Type == INTEGER_KIND)
  1682.                                 Node->Special.Integer.MaxChars = TagItem->ti_Data;
  1683.  
  1684.                             break;
  1685.                     }
  1686.                 }
  1687.             }
  1688.  
  1689.             if(Handle->Failed)
  1690.                 return;
  1691.  
  1692.             switch(Type)
  1693.             {
  1694.                 case STRING_KIND:
  1695.                 case INTEGER_KIND:
  1696.                 case FRACTION_KIND:
  1697.  
  1698.                     if(Node->Special.String.MaxHistoryLines)
  1699.                     {
  1700.                         if(!Node->Special.Integer.HistoryHook)
  1701.                         {
  1702.                             struct Hook *Hook;
  1703.  
  1704.                             if(Hook = (struct Hook *)LTP_Alloc(Handle,sizeof(struct Hook) + sizeof(struct MinList)))
  1705.                             {
  1706.                                 struct MinList *List;
  1707.  
  1708.                                 List = Hook->h_Data = (APTR)(Hook + 1);
  1709.  
  1710.                                 NewList((struct List *)List);
  1711.  
  1712.                                 Hook->h_Entry = (HOOKFUNC)LTP_DefaultHistoryHook;
  1713.  
  1714.                                 Node->Special.Integer.HistoryHook = Hook;
  1715.                             }
  1716.                         }
  1717.  
  1718.                         if(Node->Special.Integer.HistoryHook)
  1719.                         {
  1720.                             struct Node    *TextNode;
  1721.                             struct MinList *List;
  1722.  
  1723.                             List = (struct List *)Node->Special.Integer.HistoryHook->h_Data;
  1724.  
  1725.                             Node->Special.Integer.LayoutHandle = Handle;
  1726.                             Node->Special.Integer.NumHistoryLines = 0;
  1727.  
  1728.                             TextNode = (struct Node *)List->mlh_Head;
  1729.  
  1730.                             while(TextNode->ln_Succ)
  1731.                             {
  1732.                                 Node->Special.Integer.NumHistoryLines++;
  1733.  
  1734.                                 TextNode = TextNode->ln_Succ;
  1735.                             }
  1736.                         }
  1737.                     }
  1738.  
  1739.                     break;
  1740.  
  1741. #if defined(DO_BOOPSI_KIND) && defined(DO_TAB_KIND)
  1742.  
  1743.                 case TAB_KIND:
  1744.  
  1745.                     Node->Special.Tab.Parent = Handle->CurrentGroup;
  1746.                     break;
  1747. #endif
  1748.  
  1749. #ifdef DO_BOOPSI_KIND
  1750.                 case BOOPSI_KIND:
  1751.  
  1752.                     Node->Special.BOOPSI.Parent = Handle->CurrentGroup;
  1753.  
  1754.                     if(Node->Special.BOOPSI.ClassTags = CloneTagItems(TagList))
  1755.                     {
  1756.                         STATIC ULONG Exclude[] =
  1757.                         {
  1758.                             LA_Chars,
  1759.                             LA_Lines,
  1760.                             LABO_TagCurrent,
  1761.                             LABO_TagTextAttr,
  1762.                             LABO_TagDrawInfo,
  1763.                             LABO_ClassInstance,
  1764.                             LABO_ClassName,
  1765.                             LABO_ClassLibraryName,
  1766.                             LABO_ExactWidth,
  1767.                             LABO_ExactHeight,
  1768.  
  1769.                             TAG_DONE
  1770.                         };
  1771.  
  1772.                         FilterTagItems(Node->Special.BOOPSI.ClassTags,(Tag *)Exclude,TAGFILTER_NOT);
  1773.                     }
  1774.                     else
  1775.                         Handle->Failed = TRUE;
  1776.  
  1777.                     break;
  1778. #endif    /* DO_BOOPSI_KIND */
  1779.  
  1780.                 case TEXT_KIND:
  1781.  
  1782.                     if(Node->Special.Text.CopyText && Node->Special.Text.Text)
  1783.                     {
  1784.                         STRPTR text;
  1785.  
  1786.                         if(text = LTP_Alloc(Handle,strlen(Node->Special.Text.Text) + 1))
  1787.                         {
  1788.                             strcpy(text,Node->Special.Text.Text);
  1789.  
  1790.                             Node->Special.Text.Text = text;
  1791.                         }
  1792.                     }
  1793.  
  1794.                     break;
  1795.  
  1796.                 case BOX_KIND:
  1797.  
  1798.                     if(FirstLine != -1 && LastLine != -1)
  1799.                     {
  1800.                         if(FirstLine <= LastLine && Handle->LocaleHook)
  1801.                         {
  1802.                             LONG Count = LastLine - FirstLine + 1;
  1803.  
  1804.                             if(Node->Lines && Count > Node->Lines)
  1805.                                 Count = Node->Lines;
  1806.                             else
  1807.                                 Node->Lines = Count;
  1808.  
  1809.                             if(Count)
  1810.                             {
  1811.                                 if(!Node->Special.Box.Lines)
  1812.                                     Node->Special.Box.Lines = LTP_Alloc(Handle,sizeof(STRPTR) * Count);
  1813.  
  1814.                                 if(Node->Special.Box.Lines)
  1815.                                 {
  1816.                                     LONG i;
  1817.  
  1818.                                     for(i = 0 ; i < Count ; i++)
  1819.                                         Node->Special.Box.Lines[i] = (STRPTR)CallHookPkt(Handle->LocaleHook,Handle,(APTR)(FirstLine + i));
  1820.                                 }
  1821.                             }
  1822.                         }
  1823.                         else
  1824.                             Handle->Failed = TRUE;
  1825.                     }
  1826.                     else
  1827.                     {
  1828.                         if(LineTable)
  1829.                         {
  1830.                             if(Handle->LocaleHook)
  1831.                             {
  1832.                                 LONG Count = 0;
  1833.  
  1834.                                 while(LineTable[Count] != -1)
  1835.                                     Count++;
  1836.  
  1837.                                 if(Node->Lines && Count > Node->Lines)
  1838.                                     Count = Node->Lines;
  1839.                                 else
  1840.                                     Node->Lines = Count;
  1841.  
  1842.                                 if(Count)
  1843.                                 {
  1844.                                     if(!Node->Special.Box.Lines)
  1845.                                         Node->Special.Box.Lines = LTP_Alloc(Handle,sizeof(STRPTR) * Count);
  1846.  
  1847.                                     if(Node->Special.Box.Lines)
  1848.                                     {
  1849.                                         LONG i;
  1850.  
  1851.                                         for(i = 0 ; i < Count ; i++)
  1852.                                             Node->Special.Box.Lines[i] = (STRPTR)CallHookPkt(Handle->LocaleHook,Handle,(APTR)(LineTable[i]));
  1853.                                     }
  1854.                                 }
  1855.                             }
  1856.                             else
  1857.                                 Handle->Failed = TRUE;
  1858.                         }
  1859.                         else
  1860.                         {
  1861.                             if(BoxLine)
  1862.                             {
  1863.                                 LONG Count,i;
  1864.  
  1865.                                 for(i = 0, Count = 1 ; i < strlen(BoxLine) ; i++)
  1866.                                 {
  1867.                                     if(BoxLine[i] == '\n')
  1868.                                         Count++;
  1869.                                 }
  1870.  
  1871.                                 if(Node->Lines && Count > Node->Lines)
  1872.                                     Count = Node->Lines;
  1873.                                 else
  1874.                                     Node->Lines = Count;
  1875.  
  1876.                                 if(Count)
  1877.                                 {
  1878.                                     if(!Node->Special.Box.Lines)
  1879.                                         Node->Special.Box.Lines = LTP_Alloc(Handle,sizeof(STRPTR) * Count);
  1880.  
  1881.                                     if(Node->Special.Box.Lines)
  1882.                                     {
  1883.                                         STRPTR From,To;
  1884.                                         LONG Len;
  1885.  
  1886.                                         From = BoxLine;
  1887.  
  1888.                                         for(i = 0 ; i < Count ; i++)
  1889.                                         {
  1890.                                             for(To = From ; *To ; To++)
  1891.                                             {
  1892.                                                 if(*To == '\n')
  1893.                                                     break;
  1894.                                             }
  1895.  
  1896.                                             Len = (LONG)(To - From);
  1897.  
  1898.                                             if(Node->Special.Box.Lines[i] = LTP_Alloc(Handle,Len + 1))
  1899.                                             {
  1900.                                                 if(Len)
  1901.                                                     CopyMem(From,Node->Special.Box.Lines[i],Len);
  1902.  
  1903.                                                 Node->Special.Box.Lines[i][Len] = 0;
  1904.  
  1905.                                                 From = To + 1;
  1906.                                             }
  1907.                                         }
  1908.                                     }
  1909.                                 }
  1910.                             }
  1911.                         }
  1912.                     }
  1913.  
  1914.                     break;
  1915.             }
  1916.  
  1917.             if((FirstLabel != -1 && LastLabel != -1) || LabelTable)
  1918.             {
  1919.                 if(!Handle->LocaleHook)
  1920.                     Handle->Failed = TRUE;
  1921.                 else
  1922.                 {
  1923.                     if(Type == LISTVIEW_KIND)
  1924.                     {
  1925.                         struct List *SomeList;
  1926.  
  1927.                         if(SomeList = (struct List *)LTP_Alloc(Handle,sizeof(struct MinList)))
  1928.                         {
  1929.                             struct Node    *SomeNode;
  1930.                             LONG         Count = (LastLabel - FirstLabel + 1),i;
  1931.  
  1932.                             NewList(SomeList);
  1933.  
  1934.                             Node->Special.List.Labels = SomeList;
  1935.  
  1936.                             if(LabelTable)
  1937.                             {
  1938.                                 while(*LabelTable != -1)
  1939.                                 {
  1940.                                     if(SomeNode = LTP_Alloc(Handle,sizeof(struct Node)))
  1941.                                     {
  1942.                                         SomeNode->ln_Name = (STRPTR)CallHookPkt(Handle->LocaleHook,Handle,(APTR)(*LabelTable++));
  1943.  
  1944.                                         AddTail(SomeList,SomeNode);
  1945.                                     }
  1946.                                 }
  1947.                             }
  1948.                             else
  1949.                             {
  1950.                                 for(i = 0 ; i < Count ; i++)
  1951.                                 {
  1952.                                     if(SomeNode = LTP_Alloc(Handle,sizeof(struct Node)))
  1953.                                     {
  1954.                                         SomeNode->ln_Name = (STRPTR)CallHookPkt(Handle->LocaleHook,Handle,(APTR)(FirstLabel + i));
  1955.  
  1956.                                         AddTail(SomeList,SomeNode);
  1957.                                     }
  1958.                                 }
  1959.                             }
  1960.                         }
  1961.                     }
  1962.                     else
  1963.                     {
  1964.                         if(Type == MX_KIND || Type == CYCLE_KIND || Type == POPUP_KIND || Type == TAB_KIND || Type == BOX_KIND || Type == BUTTON_KIND)
  1965.                         {
  1966.                             STRPTR    *Labels;
  1967.                             LONG     Count,i;
  1968.  
  1969.                             if(LabelTable)
  1970.                             {
  1971.                                 LONG *Index = LabelTable;
  1972.  
  1973.                                 for(Count = 0 ; *Index != -1 ; Count++, Index++);
  1974.                             }
  1975.                             else
  1976.                                 Count = (LastLabel - FirstLabel + 1);
  1977.  
  1978.                             if(Labels = LTP_Alloc(Handle,sizeof(STRPTR) * (Count + 1)))
  1979.                             {
  1980.                                 if(LabelTable)
  1981.                                 {
  1982.                                     for(i = 0 ; i < Count ; i++)
  1983.                                         Labels[i] = (STRPTR)CallHookPkt(Handle->LocaleHook,Handle,(APTR)(*LabelTable++));
  1984.                                 }
  1985.                                 else
  1986.                                 {
  1987.                                     for(i = 0 ; i < Count ; i++)
  1988.                                         Labels[i] = (STRPTR)CallHookPkt(Handle->LocaleHook,Handle,(APTR)(FirstLabel + i));
  1989.                                 }
  1990.  
  1991.                                 Labels[i] = NULL;
  1992.  
  1993.                                 switch(Type)
  1994.                                 {
  1995.                                     case BUTTON_KIND:
  1996.  
  1997.                                         Node->Special.Button.Lines = Labels;
  1998.                                         break;
  1999.  
  2000.                                     case MX_KIND:
  2001.  
  2002.                                         Node->Special.Radio.Choices = Labels;
  2003.                                         break;
  2004.  
  2005.                                     case CYCLE_KIND:
  2006.  
  2007.                                         Node->Special.Cycle.Choices = Labels;
  2008.                                         break;
  2009.  
  2010. #if defined(DO_POPUP_KIND) && defined(DO_BOOPSI_KIND)
  2011.                                     case POPUP_KIND:
  2012.  
  2013.                                         Node->Special.Popup.Choices = Labels;
  2014.                                         break;
  2015. #endif
  2016.  
  2017. #if defined(DO_TAB_KIND) && defined(DO_BOOPSI_KIND)
  2018.                                     case TAB_KIND:
  2019.  
  2020.                                         Node->Special.Tab.Choices = Labels;
  2021.                                         break;
  2022. #endif
  2023.  
  2024.                                     case BOX_KIND:
  2025.  
  2026.                                         if(!Node->Special.Box.Lines)
  2027.                                         {
  2028.                                             if(Node->Special.Box.Lines = LTP_Alloc(Handle,sizeof(STRPTR) * Count))
  2029.                                             {
  2030.                                                 LONG i;
  2031.  
  2032.                                                 for(i = 0 ; i < Count ; i++)
  2033.                                                     Node->Special.Box.Lines[i] = "";
  2034.                                             }
  2035.                                         }
  2036.  
  2037.                                         Node->Lines = Count;
  2038.  
  2039.                                         Node->Special.Box.Labels = Labels;
  2040.  
  2041.                                         break;
  2042.                                 }
  2043.                             }
  2044.                         }
  2045.                     }
  2046.                 }
  2047.             }
  2048.  
  2049.             switch(Type)
  2050.             {
  2051.                 case BUTTON_KIND:
  2052.  
  2053.                     if(!Node->NoKey && !Node->Special.Button.KeyStroke && (Node->Special.Button.Lines || Node->Special.Button.ReturnKey))
  2054.                     {
  2055.                         ULONG    Len;
  2056.                         STRPTR    Label,*Index = Node->Special.Button.Lines;
  2057.                         BOOL    GotIt = FALSE;
  2058.  
  2059.                         while(!GotIt)
  2060.                         {
  2061.                             if(Index)
  2062.                             {
  2063.                                 if(!(Label = *Index++))
  2064.                                     break;
  2065.                             }
  2066.                             else
  2067.                             {
  2068.                                 Label = Node->Label;
  2069.                                 GotIt = TRUE;
  2070.                             }
  2071.  
  2072.                             Len = 0;
  2073.  
  2074.                             while(Label[Len])
  2075.                             {
  2076.                                 if(Label[Len] == '_' && Label[Len + 1])
  2077.                                 {
  2078.                                     STRPTR NewLabel = LTP_Alloc(Handle,strlen(Label));
  2079.  
  2080.                                     if(NewLabel)
  2081.                                     {
  2082.                                         if(Len)
  2083.                                             CopyMem(Label,NewLabel,Len);
  2084.  
  2085.                                         strcpy(&NewLabel[Len],&Label[Len + 1]);
  2086.  
  2087.                                         Node->Special.Button.KeyStroke = &NewLabel[Len];
  2088.  
  2089.                                         Node->Key = ToLower(NewLabel[Len]);
  2090.  
  2091.                                         if(Index)
  2092.                                             Index[-1] = NewLabel;
  2093.                                         else
  2094.                                             Node->Label = NewLabel;
  2095.                                     }
  2096.  
  2097.                                     GotIt = TRUE;
  2098.  
  2099.                                     break;
  2100.                                 }
  2101.  
  2102.                                 Len++;
  2103.                             }
  2104.                         }
  2105.                     }
  2106.  
  2107.                     break;
  2108.  
  2109.                 case BOX_KIND:
  2110.  
  2111.                     if(Node->Special.Box.ReserveSpace)
  2112.                     {
  2113.                         LONG    Size;
  2114.                         STRPTR    Buffer;
  2115.  
  2116.                         if(!Node->Special.Box.Lines)
  2117.                         {
  2118.                             if(Node->Special.Box.Lines = LTP_Alloc(Handle,sizeof(STRPTR) * Node->Lines))
  2119.                             {
  2120.                                 LONG i;
  2121.  
  2122.                                 for(i = 0 ; i < Node->Lines ; i++)
  2123.                                     Node->Special.Box.Lines[i] = "";
  2124.                             }
  2125.                         }
  2126.  
  2127.                         if(!Node->Chars)
  2128.                             Size = 10;
  2129.                         else
  2130.                             Size = Node->Chars;
  2131.  
  2132.                         Node->Special.Box.MaxSize = Size;
  2133.  
  2134.                         if(Buffer = (STRPTR)LTP_Alloc(Handle,(Size + 1) * Node->Lines))
  2135.                         {
  2136.                             LONG i,Len;
  2137.  
  2138.                             for(i = 0 ; i < Node->Lines ; i++)
  2139.                             {
  2140.                                 if(Node->Special.Box.Lines[i])
  2141.                                 {
  2142.                                     Len = strlen(Node->Special.Box.Lines[i]);
  2143.  
  2144.                                     if(Len > Size)
  2145.                                         Len = Size;
  2146.  
  2147.                                     CopyMem(Node->Special.Box.Lines[i],Buffer,Len);
  2148.  
  2149.                                     Buffer[Len] = 0;
  2150.                                 }
  2151.                                 else
  2152.                                     Buffer[0] = 0;
  2153.  
  2154.                                 Node->Special.Box.Lines[i] = Buffer;
  2155.  
  2156.                                 Buffer += Size + 1;
  2157.                             }
  2158.                         }
  2159.                     }
  2160.  
  2161.                     break;
  2162.  
  2163.                 case XBAR_KIND:
  2164.                 case YBAR_KIND:
  2165.  
  2166.                     Node->Special.Bar.Parent = Handle->CurrentGroup;
  2167.                     break;
  2168.  
  2169. #ifdef DO_PASSWORD_KIND
  2170.  
  2171.                 case PASSWORD_KIND:
  2172.                 {
  2173.                     STRPTR Buffer;
  2174.  
  2175.                     if(Buffer = LTP_Alloc(Handle,2 * (Node->Special.String.MaxChars + 1)))
  2176.                     {
  2177.                         Node->Special.String.RealString    = Buffer;
  2178.                         Node->Special.String.Original    = Buffer + Node->Special.String.MaxChars + 1;
  2179.  
  2180.                         if(Node->Special.String.String)
  2181.                         {
  2182.                             strcpy(Node->Special.String.RealString,Node->Special.String.String);
  2183.                             strcpy(Node->Special.String.Original,Node->Special.String.String);
  2184.                         }
  2185.                     }
  2186.  
  2187.                     break;
  2188.                 }
  2189. #endif
  2190.  
  2191.                 case FRACTION_KIND:
  2192.  
  2193.                     Node->Special.String.RealString = LTP_Alloc(Handle,Node->Special.String.MaxChars + 1);
  2194.                     break;
  2195.             }
  2196.  
  2197.             if(ParentList)
  2198.                 AddTail((struct List *)ParentList,(struct Node *)Node);
  2199.         }
  2200.     }
  2201. }
  2202.  
  2203.  
  2204. /*****************************************************************************/
  2205.  
  2206.  
  2207. /****** gtlayout.library/LT_NewA ******************************************
  2208. *
  2209. *   NAME
  2210. *    LT_NewA -- Add a new object to the user interface tree.
  2211. *
  2212. *   SYNOPSIS
  2213. *    LT_NewA(Handle,Tags);
  2214. *             A0    A1
  2215. *
  2216. *    VOID LT_NewA(LayoutHandle *,struct TagItem *);
  2217. *
  2218. *    LT_New(Handle,...);
  2219. *
  2220. *    VOID LT_New(LayoutHandle *,...);
  2221. *
  2222. *   FUNCTION
  2223. *    LT_NewA() is the routine you use to build the user interface,
  2224. *    you give layout directions, design groups, etc. and finally
  2225. *    call LT_BuildA() to turn these specifications into a window.
  2226. *
  2227. *   INPUTS
  2228. *    Handle - Pointer to LayoutHandle structure.
  2229. *
  2230. *
  2231. *    This routine will accept almost all create-time tag items
  2232. *    gadtools.library/CreateGadget will handle. In addition to
  2233. *    this there are a bunch of extra gadget objects and extra
  2234. *    tag items supported:
  2235. *
  2236. *    All object types:
  2237. *
  2238. *        LA_Type (LONG) - Type of the object to create, must be
  2239. *            one of the following:
  2240. *
  2241. *                TEXT_KIND
  2242. *                VERTICAL_KIND
  2243. *                HORIZONTAL_KIND
  2244. *                END_KIND
  2245. *                FRAME_KIND
  2246. *                BOX_KIND
  2247. *                SLIDER_KIND
  2248. *                LISTVIEW_KIND
  2249. *                INTEGER_KIND
  2250. *                STRING_KIND
  2251. *                PASSWORD_KIND
  2252. *                PALETTE_KIND
  2253. *                BUTTON_KIND
  2254. *                CHECKBOX_KIND
  2255. *                NUMBER_KIND
  2256. *                GAUGE_KIND
  2257. *                CYCLE_KIND
  2258. *                POPUP_KIND
  2259. *                TAB_KIND
  2260. *                MX_KIND
  2261. *                XBAR_KIND
  2262. *                YBAR_KIND
  2263. *                TAPEDECK_KIND
  2264. *                LEVEL_KIND
  2265. *                BOOPSI_KIND
  2266. *                BLANK_KIND (V36)
  2267. *                FRACTION_KIND (V38)
  2268. *
  2269. *        LA_LabelText (STRPTR) - The object label text to use.
  2270. *
  2271. *        LA_LabelID (LONG) - The locale text ID of the string to
  2272. *            use as the object label text.
  2273. *
  2274. *                NOTE: LT_NewA() will fail if you forget
  2275. *                    to select a hook with LAHN_LocaleHook
  2276. *                    at LT_CreateHandleTagList.
  2277. *
  2278. *        LA_ID (LONG) - The gadget ID to use for this object.
  2279. *
  2280. *                NOTE: User ID values *MUST* be greater than 0,
  2281. *                      negative values are reserved for internal
  2282. *                      use.
  2283. *
  2284. *        LA_Chars (LONG) - The width of this object measured in
  2285. *            characters. If each character of the user interface
  2286. *            font is 8 pixels wide an object with LA_Chars set to
  2287. *            10 will usually be 80 pixels wide.
  2288. *
  2289. *        LA_LabelChars (LONG) - This forces the internal gadget
  2290. *            label width the layout engine calculates during the
  2291. *            layout pass to a specific value. Note: this does
  2292. *            not work well with all objects. (V9)
  2293. *
  2294. *        LA_LabelPlace (LONG) - Where to place the gadget label.
  2295. *            Not all objects will support all label positions:
  2296. *
  2297. *                PLACE_LEFT - Place label text left of object
  2298. *                PLACE_RIGHT - Place label text right of object
  2299. *                PLACE_ABOVE - Place label text above object
  2300. *                PLACE_IN - Place label text in object
  2301. *                PLACE_BELOW - Place label text below object
  2302. *
  2303. *        LA_ExtraSpace (BOOL) - Add extra vertical/horizontal
  2304. *            space before this object.
  2305. *            Default: FALSE
  2306. *
  2307. *        LA_ExtraFat (BOOL) - Make this object a bit larger
  2308. *            than its usual size.
  2309. *            Default: FALSE
  2310. *
  2311. *        LA_NoKey (BOOL) - Don't let the user interface choose
  2312. *            a keyboard shortcut for this object.
  2313. *            Default: FALSE
  2314. *
  2315. *        LA_HighLabel (BOOL) - Use highlight pen when rendering
  2316. *            the gadget label text.
  2317. *            Default: FALSE
  2318. *
  2319. *        LA_BYTE (BYTE *) - Pointer to the variable that holds
  2320. *            the "current value" of the object. The layout engine
  2321. *            will retrieve this value initially during the creation
  2322. *            of the object and maintain it during its lifespan.
  2323. *            This means you do not need to worry about checking
  2324. *            the state of the object, the user interface layout
  2325. *            engine will do it for you.
  2326. *
  2327. *        LA_UBYTE (UBYTE *) - Pointer to the variable that holds
  2328. *            the "current value" of the object. The layout engine
  2329. *            will retrieve this value initially during the creation
  2330. *            of the object and maintain it during its lifespan.
  2331. *            This means you do not need to worry about checking
  2332. *            the state of the object, the user interface layout
  2333. *            engine will do it for you.
  2334. *
  2335. *        LA_WORD (WORD *) - Pointer to the variable that holds
  2336. *            the "current value" of the object. The layout engine
  2337. *            will retrieve this value initially during the creation
  2338. *            of the object and maintain it during its lifespan.
  2339. *            This means you do not need to worry about checking
  2340. *            the state of the object, the user interface layout
  2341. *            engine will do it for you.
  2342. *
  2343. *        LA_UWORD (UWORD *) - Pointer to the variable that holds
  2344. *            the "current value" of the object. The layout engine
  2345. *            will retrieve this value initially during the creation
  2346. *            of the object and maintain it during its lifespan.
  2347. *            This means you do not need to worry about checking
  2348. *            the state of the object, the user interface layout
  2349. *            engine will do it for you.
  2350. *
  2351. *        LA_BOOL (BOOL *) - Pointer to the variable that holds
  2352. *            the "current value" of the object. The layout engine
  2353. *            will retrieve this value initially during the creation
  2354. *            of the object and maintain it during its lifespan.
  2355. *            This means you do not need to worry about checking
  2356. *            the state of the object, the user interface layout
  2357. *            engine will do it for you.
  2358. *
  2359. *        LA_LONG (LONG *) - Pointer to the variable that holds
  2360. *            the "current value" of the object. The layout engine
  2361. *            will retrieve this value initially during the creation
  2362. *            of the object and maintain it during its lifespan.
  2363. *            This means you do not need to worry about checking
  2364. *            the state of the object, the user interface layout
  2365. *            engine will do it for you.
  2366. *
  2367. *        LA_ULONG (ULONG *) - Pointer to the variable that holds
  2368. *            the "current value" of the object. The layout engine
  2369. *            will retrieve this value initially during the creation
  2370. *            of the object and maintain it during its lifespan.
  2371. *            This means you do not need to worry about checking
  2372. *            the state of the object, the user interface layout
  2373. *            engine will do it for you.
  2374. *
  2375. *        LA_STRPTR (STRPTR) - Pointer to the variable that holds
  2376. *            the "current value" of the object. The layout engine
  2377. *            will retrieve this value initially during the creation
  2378. *            of the object and maintain it during its lifespan.
  2379. *            This means you do not need to worry about checking
  2380. *            the state of the object, the user interface layout
  2381. *            engine will do it for you.
  2382. *
  2383. *        LA_FRACTION (FRACTION *) - Pointer to the variable that holds
  2384. *            the "current value" of the object. The layout engine
  2385. *            will retrieve this value initially during the creation
  2386. *            of the object and maintain it during its lifespan.
  2387. *            This means you do not need to worry about checking
  2388. *            the state of the object, the user interface layout
  2389. *            engine will do it for you.
  2390. *
  2391. *
  2392. *        TEXT_KIND:
  2393. *
  2394. *            LATX_Picker (BOOL) - Attach a `select' button to the
  2395. *                right hand side of the text display.
  2396. *                Default: FALSE
  2397. *
  2398. *            LATX_LockSize (BOOL) - After doing the initial layout
  2399. *                for this object, do not adapt its size again during
  2400. *                subsequent layouts. This is particularly useful if
  2401. *                you have a TEXT_KIND object in a paged group
  2402. *                and update its contents later. You need
  2403. *                to specify an object width using LA_Chars, otherwise
  2404. *                the layout engine may make it not wide enough to
  2405. *                display any text. (V15)
  2406. *
  2407. *
  2408. *        VERTICAL_KIND (group to align objects vertically):
  2409. *        HORIZONTAL_KIND (group to align objects horizontally):
  2410. *
  2411. *            LAGR_Spread (BOOL) - Place all objects in this
  2412. *                group with roughly the same amount of space
  2413. *                between them.
  2414. *                Default: FALSE
  2415. *
  2416. *            LAGR_SameSize (BOOL) - Make all objects in this
  2417. *                group the same size (for vertical groups:
  2418. *                the same height, for horizontal groups:
  2419. *                the same width).
  2420. *                Default: FALSE
  2421. *
  2422. *            LAGR_LastAttributes (BOOL) - Try to copy the
  2423. *                size of the previous group for this new
  2424. *                group. May not work if this group turns
  2425. *                out to be larger than the previous group.
  2426. *                Default: FALSE
  2427. *
  2428. *            LAGR_ActivePage (LONG) - Organize all child
  2429. *                groups as pages which can be flipped through
  2430. *                using LT_SetAttributes(). You need to
  2431. *                specify the number of the first page to
  2432. *                display, starting from 0.
  2433. *
  2434. *                    NOTE: Specifying this tag actually enables
  2435. *                        the paging feature. If you omit this
  2436. *                        tag calls to flip to a specific
  2437. *                        page will fail.
  2438. *
  2439. *                Default: No paging
  2440. *
  2441. *            LAGR_Frame (BOOL) - Draw a recessed frame around
  2442. *                this group, even if there is no group label. (V7)
  2443. *
  2444. *            LAGR_IndentX (BOOL) - Add extra horizontal indentation
  2445. *                for this group. (V10)
  2446. *
  2447. *            LAGR_IndentY (BOOL) - Add extra vertical indentation
  2448. *                for this group. (V10)
  2449. *
  2450. *            LAGR_NoIndent (BOOL) - Inhibit automatic size adjustion
  2451. *                and centring of this group if it is smaller than
  2452. *                the neighbouring groups. (V21)
  2453. *
  2454. *            LAGR_SameWidth (WORD) - During the final layout pass,
  2455. *                make this group the same width as the group which
  2456. *                uses the given ID. Not implemented yet. (V25)
  2457. *
  2458. *            LAGR_SameHeight (WORD) - During the final layout pass,
  2459. *                make this group the same height as the group which
  2460. *                uses the given ID. Not implemented yet. (V25)
  2461. *
  2462. *           LAGR_FrameGroup (UWORD) - Surround this group with a
  2463. *               frame. Must be one of FRAMETYPE_Label or FRAMETYPE_Tab.
  2464. *               FRAMETYPE_Label works like "LAGR_Frame,TRUE," while
  2465. *               FRAMETYPE_Tab is for use with a TAB_KIND object you
  2466. *               must put directly on top of this group or the group
  2467. *               will look a little silly. (V38)
  2468. *
  2469. *
  2470. *        FRAME_KIND (fixed size general purpose display,
  2471. *            you may render into it):
  2472. *
  2473. *            LAFR_InnerWidth (LONG) - Inner width of the
  2474. *                display box.
  2475. *
  2476. *            LAFR_InnerHeight (LONG) - Inner height of the
  2477. *                display box.
  2478. *
  2479. *            LAFR_DrawBox (BOOL) - Draw a recessed bevel box
  2480. *                around the display box.
  2481. *                Default: FALSE
  2482. *
  2483. *            LAFR_RefreshHook (struct Hook *) - Hook to call
  2484. *                when refreshing/redrawing this object. See
  2485. *                gtlayout.h for more information. (V9)
  2486. *
  2487. *            LAFR_GenerateEvents (BOOL) - If TRUE, clicking
  2488. *                inside the FRAME_KIND object will generate
  2489. *                IDCMP_GADGETUP/IDCMP_GADGETDOWN events. If
  2490. *                you wish to know where the click occured,
  2491. *                make a copy of the Window->MouseX/Y entries
  2492. *                before you call LT_HandleInput()/LT_GetIMsg(). (V28)
  2493. *                Default: FALSE
  2494. *
  2495. *
  2496. *        XBAR_KIND (horizontal separator bar):
  2497. *
  2498. *            LAXB_FullSize (BOOL) - Make this separator bar span
  2499. *                the entire window width.
  2500. *
  2501. *        BLANK_KIND (transparent placeholder):
  2502. *
  2503. *            No tags are defined for this type of object (V36).
  2504. *
  2505. *        BOX_KIND (multiline text display):
  2506. *
  2507. *            LABX_Chars (LONG) - The width of this object in
  2508. *                characters. The layout routine will try to make
  2509. *                sure that the given number of characters will
  2510. *                fit into a single line of text in this box.
  2511. *                This may be a problem with proportional spaced
  2512. *                fonts.
  2513. *               Default: 10
  2514. *
  2515. *            LABX_Labels (STRPTR *) - The label texts to display
  2516. *                on the right hand side of the box. Terminate
  2517. *                this array with NULL.
  2518. *
  2519. *            LABX_Lines (STRPTR *) - The text to display in the
  2520. *                box. Terminate this array with NULL.
  2521. *
  2522. *            LABX_Rows (LONG) - The height of this object in
  2523. *                characters.
  2524. *
  2525. *            LABX_AlignText (LONG) - Controls how text is aligned
  2526. *                in box lines:
  2527. *
  2528. *                    ALIGNTEXT_LEFT - Align text to the left edge
  2529. *                    ALIGNTEXT_CENTERED - Centre the text
  2530. *                    ALIGNTEXT_RIGHT - Align text to the right edge
  2531. *                    ALIGNTEXT_PAD - Pad text lines
  2532. *
  2533. *                Default: ALIGNTEXT_LEFT
  2534. *
  2535. *            LABX_DrawBox (BOOL) - Draw a recessed bevel box
  2536. *                around the text box.
  2537. *                Default: FALSE
  2538. *
  2539. *            LABX_FirstLabel (LONG) - Locale string ID of the first
  2540. *                text to use as a box label. Works in conjunction
  2541. *                with LABX_LastLabel.
  2542. *
  2543. *            LABX_LastLabel (LONG) - Locale string ID of the last
  2544. *                text to use as a box label. Works in conjunction
  2545. *                with LABX_FirstLabel. When building the interface the
  2546. *                code will loop from FirstLabel..LastLabel, look
  2547. *                up the corresponding locale strings and use the
  2548. *                data to make up the label text to appear at the
  2549. *                right hand side of the box.
  2550. *
  2551. *            LABX_LabelTable (LONG *) - Pointer to an array of IDs
  2552. *                to use for building the box labels. This requires
  2553. *                that a locale hook is provided with the layout handle.
  2554. *                The array is terminated by -1.
  2555. *
  2556. *            LABX_ReserveSpace (BOOL) - Allocate extra memory to hold
  2557. *                the contents of the lines displayed. This avoids nasty
  2558. *                side-effects when refreshing this object.
  2559. *                Default: FALSE
  2560. *
  2561. *            LABX_FirstLine (LONG) - Locale string ID of the first
  2562. *                text to print inside the box. Works in conjunction
  2563. *                with LABX_LastLine. (V26)
  2564. *
  2565. *            LABX_LastLine (LONG) - Locale string ID of the last
  2566. *                text to print inside the box. Works in conjunction
  2567. *                with LABX_FirstLine. (V26)
  2568. *
  2569. *            LABX_LineTable (LONG *) - Pointer to an array of IDs
  2570. *                to use for building the box contents lines. This requires
  2571. *                that a locale hook is provided with the layout handle.
  2572. *                The array is terminated by -1. (V28)
  2573. *
  2574. *            LABX_Line (STRPTR) - Line to display in the box, may
  2575. *                contain '\n' line break characters, the layout engine
  2576. *                will chop the single line into single consecutive lines
  2577. *                following the '\n' chars. (V31)
  2578. *
  2579. *            LABX_LineID (LONG) - Locale ID of line text to display in the
  2580. *                box, may contain '\n' line break characters, the layout
  2581. *                engine will chop the single line into single consecutive lines
  2582. *                following the '\n' chars. (V31)
  2583. *
  2584. *        SLIDER_KIND:
  2585. *
  2586. *            LASL_FullCheck: TRUE will cause the code to rattle
  2587. *                through all possible slider settings, starting
  2588. *                from the minimum value, ending at the maximum value.
  2589. *                While this may be a good idea for a display
  2590. *                function to map slider levels to text strings
  2591. *                of varying length it might be a problem when
  2592. *                it comes to display a range of numbers from
  2593. *                1 to 40,000: the code will loop through
  2594. *                40,000 iterations trying to find the longest
  2595. *                string.
  2596. *
  2597. *                FALSE will cause the code to calculate the
  2598. *                longest level string based only on the
  2599. *                minimum and the maximum value to check.
  2600. *                While this is certainly a good a idea when
  2601. *                it comes to display a range of numbers from
  2602. *                1 to 40,000 as only two values will be
  2603. *                checked the code may fail to produce
  2604. *                accurate results for sliders using display
  2605. *                functions mapping slider levels to strings.
  2606. *
  2607. *                Default: TRUE
  2608. *
  2609. *
  2610. *        LEVEL_KIND:
  2611. *
  2612. *            All tags are supported which SLIDER_KIND supports.
  2613. *            The gadget level display however, can only be aligned
  2614. *            to the left border.
  2615. *
  2616. *
  2617. *        LISTVIEW_KIND:
  2618. *
  2619. *            LALV_ExtraLabels (STRPTR *) - Place extra line
  2620. *                labels at the right of the box. Terminate
  2621. *                this array with NULL.
  2622. *
  2623. *            LALV_Labels (STRPTR *) - The labels to display
  2624. *                inside the box, you can pass this array of
  2625. *                strings in rather than passing an initialized
  2626. *                List of text via GTLV_Labels. Terminate
  2627. *                this array with NULL.
  2628. *
  2629. *            LALV_CursorKey (BOOL) - Let the user operate this
  2630. *                listview using the cursor keys.
  2631. *
  2632. *                    NOTE: there can be only one single listview
  2633. *                        per window to sport this feature.
  2634. *
  2635. *                Default: FALSE
  2636. *
  2637. *            LALV_Lines (LONG) - The number of text lines this
  2638. *                listview is to display.
  2639. *
  2640. *            LALV_Link (LONG) - The Gadget ID of a string gadget
  2641. *                to attach to this listview.
  2642. *
  2643. *                    NOTE: you need to
  2644. *                        add the Gadget in question before you add the
  2645. *                        listview to refer to it or the layout routine
  2646. *                        will get confused.
  2647. *
  2648. *                Passing the value NIL_LINK will create a listview
  2649. *                which displays the currently selected item, otherwise
  2650. *                you will get a read-only list.
  2651. *
  2652. *            LALV_FirstLabel (LONG) - Locale string ID of the first
  2653. *                text to use as a list label. Works in conjunction
  2654. *                with LALV_LastLabel.
  2655. *
  2656. *            LALV_LastLabel (LONG) - Locale string ID of the last
  2657. *                text to use as a list label. Works in conjunction
  2658. *                with LALV_FirstLabel. When building the interface the
  2659. *                code will loop from FirstLabel..LastLabel, look
  2660. *                up the corresponding locale strings and use the
  2661. *                data to make up the label text to appear in the
  2662. *                list.
  2663. *
  2664. *            LALV_LabelTable (LONG *) - Pointer to an array of IDs
  2665. *                to use for building the listview contents. This requires
  2666. *                that a locale hook is provided with the layout handle.
  2667. *                The array is terminated by -1.
  2668. *
  2669. *            LALV_MaxGrowX (LONG) - Maximum width of this object
  2670. *                measured in characters. When the first layout pass
  2671. *                is finished and there is still enough space left
  2672. *                to make the listview wider, the width is increased
  2673. *                until it hits the limit specified using this tag.
  2674. *
  2675. *                    NOTE: there can be only one single listview
  2676. *                        per window to sport this feature.
  2677. *
  2678. *                Default: 0
  2679. *
  2680. *            LALV_MaxGrowY (LONG) - Maximum height of this object
  2681. *                measured in lines. When the first layout pass is
  2682. *                finished and there is still enough space left to
  2683. *                make the listview higher, the height is increased
  2684. *                until it hits the limit specified using this tag.
  2685. *
  2686. *                    NOTE: there can be only one single listview
  2687. *                        per window to sport this feature.
  2688. *
  2689. *                Default: 0
  2690. *
  2691. *            LALV_ResizeX (BOOL) - Makes this listview resizable
  2692. *                in the horizontal direction, attaches a sizing
  2693. *                gadget to the window to open and handles window
  2694. *                resize operations automatically. (V9)
  2695. *
  2696. *                    NOTE: there can be only one single listview
  2697. *                        per window to sport this feature.
  2698. *
  2699. *                        Also listen to IDCMP_CLOSEWINDOW events
  2700. *                        which may be generated if the layout
  2701. *                        engine runs out of memory when rebuilding
  2702. *                        the user interface.
  2703. *
  2704. *                Default: FALSE
  2705. *
  2706. *            LALV_ResizeY (BOOL) - Makes this listview resizable
  2707. *                in the vertical direction, attaches a sizing
  2708. *                gadget to the window to open and handles window
  2709. *                resize operations automatically. (V9)
  2710. *
  2711. *                    NOTE: there can be only one single listview
  2712. *                        per window to sport this feature.
  2713. *
  2714. *                        Also listen to IDCMP_CLOSEWINDOW events
  2715. *                        which may be generated if the layout
  2716. *                        engine runs out of memory when rebuilding
  2717. *                        the user interface.
  2718. *
  2719. *                Default: FALSE
  2720. *
  2721. *            LALV_MinChars (WORD) - Minimum width for this
  2722. *                object, measured in characters. Used in
  2723. *                conjunction with LALV_ResizeX. (V9)
  2724. *
  2725. *            LALV_MinLines (WORD) - Minimum height for this
  2726. *                object, measured in lines. Used in
  2727. *                conjunction with LALV_ResizeY. (V9)
  2728. *
  2729. *            LALV_LockSize (BOOL) - After doing the initial layout
  2730. *                for this object, do not adapt its size again during
  2731. *                subsequent layouts. This is particularly useful if
  2732. *                you have a LISTVIEW_KIND object in a paged group
  2733. *                and keep adding new entries to the list. You need
  2734. *                to specify an object width using LA_Chars, otherwise
  2735. *                the layout engine may make it not wide enough to
  2736. *                display any entries. (V8)
  2737. *
  2738. *            LALV_FlushLabelLeft (BOOL) - For a gadget label placed
  2739. *                above the listview align the text to the left edge
  2740. *                of the view. (V9)
  2741. *
  2742. *            LALV_TextAttr (struct TextAttr *) - You can specify a
  2743. *                fixed-width font to be used for the list display.
  2744. *                The TextAttr (or TTextAttr) you provide must be ready
  2745. *                to go so the layout code can open the font later.
  2746. *
  2747. *                To get the current system default font, which is
  2748. *                guaranteed to be fixed-width, pass ~0 instead of a
  2749. *                pointer to a TextAttr structure. (V10)
  2750. *
  2751. *                    NOTE: The font *MUST* be fixed-width or the layout
  2752. *                        will fail.
  2753. *
  2754. *                         Choose your font in such a way that it matches
  2755. *                         in width and height with the other probably
  2756. *                         proportional-spaced user interface font.
  2757. *
  2758. *                         If the layout engine decides to step down in
  2759. *                         font size, all LISTVIEW_KIND objects which were
  2760. *                         configured to use a special fixed-width font
  2761. *                         will `forget' about it. This won't matter much
  2762. *                         as the fonts the engine chooses will always be
  2763. *                         fixed-width anyway.
  2764. *
  2765. *            LALV_AutoPageID (LONG) - ID of paged GROUP_KIND object
  2766. *                which will be set to the gadget's current setting.
  2767. *                If this tag is set, you will hear no events from this
  2768. *                object any more. (V23)
  2769. *
  2770. *                    NOTE: Listen to IDCMP_CLOSEWINDOW events
  2771. *                        which may be generated if the layout
  2772. *                        engine runs out of memory when rebuilding
  2773. *                        the user interface.
  2774. *
  2775. *            LALV_Selected (LONG) - In this context, this tag is an
  2776. *                alias for GTLV_Selected. See
  2777. *                gtlayout.library/LT_SetAttributes for more information
  2778. *                on how the meaning of this tag differs from this (V34).
  2779. *
  2780. *        INTEGER_KIND:
  2781. *
  2782. *            LAIN_LastGadget (BOOL) - Pressing return with this
  2783. *                gadget active will stop activating the next
  2784. *                following string gadget type if TRUE is passed.
  2785. *                Default: FALSE
  2786. *
  2787. *            LAIN_Min (LONG) - Minimum accepted numeric value.
  2788. *                Default: -2147483647
  2789. *
  2790. *            LAIN_Max (LONG) - Maximum accepted numeric value.
  2791. *                Default:  2147483647
  2792. *
  2793. *            LAIN_UseIncrementers (BOOL) - Use TRUE to add incrementer
  2794. *                arrow buttons to the right of the numeric entry field.
  2795. *                These buttons will let you cycle through a set of
  2796. *                numbers to be displayed in the numeric entry field.
  2797. *                Default: FALSE
  2798. *
  2799. *            LAIN_HistoryLines (LONG) - Number of numbers entered to
  2800. *                keep as a backlog.
  2801. *                Default: 0
  2802. *
  2803. *            LAIN_HistoryHook (struct Hook *) - Hook code to call when
  2804. *                entering a number into the backlog. See gtlayout.h for
  2805. *                more information.
  2806. *                Default: NULL
  2807. *
  2808. *            LAIN_IncrementerHook (struct Hook *) - Hook code to call
  2809. *                when cycling through numeric values. See gtlayout.h for
  2810. *                more information.
  2811. *                Default: NULL
  2812. *
  2813. *            LAIN_Activate (BOOL) - When the window opens, make this
  2814. *                gadget the active one. (V21)
  2815. *
  2816. *                    NOTE: There can be only one gadget of this type
  2817. *                        per window.
  2818. *
  2819. *                Default: FALSE
  2820. *
  2821. *
  2822. *        STRING_KIND:
  2823. *
  2824. *            LAST_LastGadget (BOOL) - Pressing return with this
  2825. *                gadget active will stop activating the next
  2826. *                following string gadget type if TRUE is passed.
  2827. *                Default: FALSE
  2828. *
  2829. *            LAST_Link (LONG) - Gadget ID of the listview to attach
  2830. *                this string gadget to.
  2831. *
  2832. *                    NOTE: you need to add the string gadget before
  2833. *                        you add the listview to refer to it or the
  2834. *                        layout routine will get confused.
  2835. *
  2836. *            LAST_Picker (BOOL) - Attach a `select' button to the
  2837. *                right hand side of the string gadget.
  2838. *                Default: FALSE
  2839. *
  2840. *            LAST_HistoryLines (LONG) - Number of lines to keep as
  2841. *                a backlog.
  2842. *                Default: 0
  2843. *
  2844. *            LAST_HistoryHook (struct Hook *) - Hook code to call
  2845. *                when entering a line into the backlog. See gtlayout.h
  2846. *                for more information.
  2847. *                Default: NULL
  2848. *
  2849. *            LAST_Activate (BOOL) - When the window opens, make this
  2850. *                gadget the active one. (V21)
  2851. *
  2852. *                    NOTE: There can be only one gadget of this type
  2853. *                        per window.
  2854. *
  2855. *                Default: FALSE
  2856. *
  2857. *        PASSWORD_KIND (string gadget type which does not
  2858. *            display its contents):
  2859. *
  2860. *            LAPW_LastGadget (BOOL) - Pressing return with this
  2861. *                gadget active will stop activating the next
  2862. *                following string gadget type if TRUE is passed.
  2863. *                Default: FALSE
  2864. *
  2865. *            LAPW_HistoryLines (LONG) - Number of lines to keep as
  2866. *                a backlog.
  2867. *                Default: 0
  2868. *
  2869. *            LAPW_HistoryHook (struct Hook *) - Hook code to call
  2870. *                when entering a line into the backlog. See gtlayout.h
  2871. *                for more information.
  2872. *                Default: NULL
  2873. *
  2874. *            LAPW_Activate (BOOL) - When the window opens, make this
  2875. *                gadget the active one. (V21)
  2876. *
  2877. *                    NOTE: There can be only one gadget of this type
  2878. *                        per window.
  2879. *
  2880. *                Default: FALSE
  2881. *
  2882. *            This object type accepts all the GTST_#? tag items.
  2883. *
  2884. *
  2885. *        FRACTION_KIND (V38):
  2886. *
  2887. *            This is a special kind of STRING_KIND which comes with a
  2888. *            special input filter. It will allow only for floating point
  2889. *            numbers to be entered, i.e. numbers (`0'-`9') and one
  2890. *            decimal pointer (`.' or whatever your current locale uses
  2891. *            as the decimal point character). What you will receive as
  2892. *            user input text will be in the following format:
  2893. *
  2894. *                (0|#[0-9]).(0|#[0-9])
  2895. *
  2896. *            Or in other words, text like this will be returned:
  2897. *
  2898. *                0.0
  2899. *                7.0
  2900. *                0.9
  2901. *                146654.0
  2902. *
  2903. *            This object type accepts all the GTST_#? tag items.
  2904. *
  2905. *            NOTE: While this object type did exist in earlier library
  2906. *                  versions support for it was removed in V33. It was
  2907. *                  eventually reintroduced with the functionality described
  2908. *                  above in V38.
  2909. *
  2910. *
  2911. *        PALETTE_KIND:
  2912. *
  2913. *            LAPA_SmallPalette (BOOL) - Make the palette display
  2914. *                a bit smaller than usual.
  2915. *                Default: FALSE
  2916. *
  2917. *            LAPA_Lines (LONG) - Number of lines the palette
  2918. *                display should cover.
  2919. *                Default: No preference
  2920. *
  2921. *            LAPA_UsePicker (BOOL) - This tag effectively changes the
  2922. *                gadget type. Instead of a list of colours to pick from
  2923. *                the user will see a rectangle filled in the selected
  2924. *                colour with a picker button next to it. This gadget
  2925. *                will generate IDCMP_IDCMPUPDATE events when the picker
  2926. *                button is pressed. (V10)
  2927. *
  2928. *
  2929. *        BUTTON_KIND:
  2930. *
  2931. *            LA_Label (STRPTR)
  2932. *            LA_LabelID (LONG) - These two define the button label, i.e.
  2933. *                the text that is printed within the button box. Optionally,
  2934. *                this text may include newline characters ("\n") which will
  2935. *                cause the button text to be broken into several lines.
  2936. *                This particular feature requires gtlayout.library v12 or
  2937. *                higher. Single line label have always been supported.
  2938. *
  2939. *            LABT_ReturnKey (BOOL) - Let the user operate this
  2940. *                button by pressing the return key, making it the
  2941. *                so-called default button, or default choice. The
  2942. *                button select box will appear slightly bolder than
  2943. *                normal buttons are.
  2944. *
  2945. *                    NOTE: there can be only one single button per
  2946. *                        window to sport this feature.
  2947. *
  2948. *                Default: FALSE
  2949. *
  2950. *            LABT_EscKey (BOOL) - Let the user operate this
  2951. *                button by pressing the Escape key.
  2952. *
  2953. *                    NOTE: there can be only one single button per
  2954. *                        window to use this feature.
  2955. *
  2956. *                Default: FALSE
  2957. *
  2958. *            LABT_ExtraFat (BOOL) - Make this button a bit
  2959. *                larger than usual.
  2960. *                Default: FALSE
  2961. *
  2962. *            LABT_Lines (STRPTR *) - Use the given string array
  2963. *                to create a multiline gadget label. Terminate the
  2964. *                array with a NULL. (V12)
  2965. *
  2966. *            LABT_FirstLine (LONG) - Locale ID of first label line. (V12)
  2967. *
  2968. *            LABT_LastLine (LONG) - Locale ID of last label line. (V12)
  2969. *
  2970. *            LABT_DefaultCorrection (BOOL) - Make the button slightly
  2971. *                wider and taller so its size matches the default
  2972. *                button. (V21)
  2973. *
  2974. *            LABT_Smaller (BOOL) - Make this button a little smaller
  2975. *                than usual. (V21)
  2976. *
  2977. *        GAUGE_KIND (general purpose progress report display):
  2978. *
  2979. *            LAGA_Percent (LONG) - Indicator position, can range
  2980. *                from 0..100.
  2981. *                Default: 0
  2982. *
  2983. *            LAGA_InfoLength (LONG) - Maximum number of characters
  2984. *                to reserve for text printed in the gauge display.
  2985. *                Default: 0
  2986. *
  2987. *            LAGA_InfoText (STRPTR) - Text to print in the gauge
  2988. *                display.
  2989. *
  2990. *            LAGA_Tenth (BOOL) - Instead of a continuously growing
  2991. *                bar you will get a set of exactly ten blocks,
  2992. *                each separated by a hairline. (V19)
  2993. *                Default: FALSE
  2994. *
  2995. *               LAGA_NoTicks (BOOL) - If TRUE suppresses drawing the
  2996. *                   ticks below the gauge box.
  2997. *                   Default: FALSE
  2998. *
  2999. *        CYCLE_KIND:
  3000. *
  3001. *            LACY_FirstLabel (LONG) - Locale string ID of the first
  3002. *                text to use as a label. Works in conjunction
  3003. *                with LACY_LastLabel.
  3004. *
  3005. *            LACY_LastLabel (LONG) - Locale string ID of the last
  3006. *                text to use as a label. Works in conjunction
  3007. *                with LACY_FirstLabel. When building the interface the
  3008. *                code will loop from FirstLabel..LastLabel, look
  3009. *                up the corresponding locale strings and use the
  3010. *                data to make up the label text.
  3011. *
  3012. *            LACY_LabelTable (LONG *) - Pointer to an array of IDs
  3013. *                to use for building the cycle labels. This requires
  3014. *                that a locale hook is provided with the layout handle.
  3015. *                The array is terminated by -1.
  3016. *
  3017. *            LACY_TabKey (BOOL) - Connect this object to the tabulator
  3018. *                key. Press [Tab] to cycle to the next entry, [Shift][Tab]
  3019. *                to cycle to the previous entry. (V9)
  3020. *
  3021. *                    NOTE: there can be only one single button per
  3022. *                        window to use this feature.
  3023. *
  3024. *                Default: FALSE
  3025. *
  3026. *            LACY_AutoPageID (LONG) - ID of paged GROUP_KIND object
  3027. *                which will be set to the gadget's current setting.
  3028. *                If this tag is set, you will hear no events from this
  3029. *                object any more. (V7)
  3030. *
  3031. *                    NOTE: Listen to IDCMP_CLOSEWINDOW events
  3032. *                        which may be generated if the layout
  3033. *                        engine runs out of memory when rebuilding
  3034. *                        the user interface.
  3035. *
  3036. *
  3037. *        POPUP_KIND:
  3038. *
  3039. *            (This features requires gtlayout.library v22 or higher
  3040. *             and Kickstart 3.0 or higher).
  3041. *
  3042. *            LAPU_FirstLabel (LONG) - Locale string ID of the first
  3043. *                text to use as a label. Works in conjunction
  3044. *                with LAPU_LastLabel.
  3045. *
  3046. *            LAPU_LastLabel (LONG) - Locale string ID of the last
  3047. *                text to use as a label. Works in conjunction
  3048. *                with LAPU_FirstLabel. When building the interface the
  3049. *                code will loop from FirstLabel..LastLabel, look
  3050. *                up the corresponding locale strings and use the
  3051. *                data to make up the label text.
  3052. *
  3053. *            LAPU_LabelTable (LONG *) - Pointer to an array of IDs
  3054. *                to use for building the cycle labels. This requires
  3055. *                that a locale hook is provided with the layout handle.
  3056. *                The array is terminated by -1.
  3057. *
  3058. *            LAPU_TabKey (BOOL) - Connect this object to the tabulator
  3059. *                key. Press [Tab] to cycle to the next entry, [Shift][Tab]
  3060. *                to cycle to the previous entry.
  3061. *
  3062. *                    NOTE: there can be only one single button per
  3063. *                        window to use this feature.
  3064. *
  3065. *                Default: FALSE
  3066. *
  3067. *            LAPU_AutoPageID (LONG) - ID of paged GROUP_KIND object
  3068. *                which will be set to the gadget's current setting.
  3069. *                If this tag is set, you will hear no events from this
  3070. *                object any more.
  3071. *
  3072. *                    NOTE: Listen to IDCMP_CLOSEWINDOW events
  3073. *                        which may be generated if the layout
  3074. *                        engine runs out of memory when rebuilding
  3075. *                        the user interface.
  3076. *
  3077. *            LAPU_CentreActive (BOOL) - If TRUE, the popup menu will
  3078. *                appear with the currently active entry centred below
  3079. *                the mouse pointer. (V31)
  3080. *
  3081. *        TAB_KIND:
  3082. *
  3083. *            (This features requires gtlayout.library v24 or higher)
  3084. *
  3085. *            LATB_FirstLabel (LONG) - Locale string ID of the first
  3086. *                text to use as a label. Works in conjunction
  3087. *                with LATB_LastLabel.
  3088. *
  3089. *            LATB_LastLabel (LONG) - Locale string ID of the last
  3090. *                text to use as a label. Works in conjunction
  3091. *                with LATB_FirstLabel. When building the interface the
  3092. *                code will loop from FirstLabel..LastLabel, look
  3093. *                up the corresponding locale strings and use the
  3094. *                data to make up the label text.
  3095. *
  3096. *            LATB_LabelTable (LONG *) - Pointer to an array of IDs
  3097. *                to use for building the cycle labels. This requires
  3098. *                that a locale hook is provided with the layout handle.
  3099. *                The array is terminated by -1.
  3100. *
  3101. *            LATB_TabKey (BOOL) - Connect this object to the tabulator
  3102. *                key. Press [Tab] to cycle to the next entry, [Shift][Tab]
  3103. *                to cycle to the previous entry.
  3104. *
  3105. *                    NOTE: there can be only one single button per
  3106. *                        window to use this feature.
  3107. *
  3108. *                Default: FALSE
  3109. *
  3110. *            LATB_AutoPageID (LONG) - ID of paged GROUP_KIND object
  3111. *                which will be set to the gadget's current setting.
  3112. *                If this tag is set, you will hear no events from this
  3113. *                object any more.
  3114. *
  3115. *                    NOTE: Listen to IDCMP_CLOSEWINDOW events
  3116. *                        which may be generated if the layout
  3117. *                        engine runs out of memory when rebuilding
  3118. *                        the user interface.
  3119. *
  3120. *            LATB_FullSize (BOOL) - By default a TAB_KIND object
  3121. *                covers the entire width of the group it sits in.
  3122. *                With LATB_FullSize set to true it will cover the
  3123. *                width of the entire Window.
  3124. *
  3125. *                Default: FALSE
  3126. *
  3127. *
  3128. *        MX_KIND:
  3129. *
  3130. *            LAMX_FirstLabel (LONG) - Locale string ID of the first
  3131. *                text to use as a label. Works in conjunction
  3132. *                with LAMX_LastLabel.
  3133. *
  3134. *            LAMX_LastLabel (LONG) - Locale string ID of the last
  3135. *                text to use as a label. Works in conjunction
  3136. *                with LAMX_FirstLabel. When building the interface the
  3137. *                code will loop from FirstLabel..LastLabel, look
  3138. *                up the corresponding locale strings and use the
  3139. *                data to make up the label text.
  3140. *
  3141. *            LAMX_LabelTable (LONG *) - Pointer to an array of IDs
  3142. *                to use for building the radio labels. This requires
  3143. *                that a locale hook is provided with the layout handle.
  3144. *                The array is terminated by -1.
  3145. *
  3146. *            LAMX_TabKey (BOOL) - Connect this object to the tabulator
  3147. *                key. Press [Tab] to cycle to the next entry, [Shift][Tab]
  3148. *                to cycle to the previous entry. (V9)
  3149. *
  3150. *                    NOTE: there can be only one single button per
  3151. *                        window to use this feature.
  3152. *
  3153. *                Default: FALSE
  3154. *
  3155. *            LAMX_AutoPageID (LONG) - ID of paged GROUP_KIND object
  3156. *                which will be set to the gadget's current setting.
  3157. *                If this tag is set, you will hear no events from this
  3158. *                object any more. (V7)
  3159. *
  3160. *                    NOTE: Listen to IDCMP_CLOSEWINDOW events
  3161. *                        which may be generated if the layout
  3162. *                        engine runs out of memory when rebuilding
  3163. *                        the user interface.
  3164. *
  3165. *
  3166. *        SCROLLER_KIND:
  3167. *
  3168. *            LASC_Thin (BOOL) - Make the scroller a bit thinner
  3169. *                than usual.
  3170. *                Default: FALSE
  3171. *
  3172. *            GA_RelVerify (BOOL) - Hear every IDCMP_GADGETUP
  3173. *                event from scroller.
  3174. *                Default: TRUE
  3175. *
  3176. *                        NOTE: This is different from what
  3177. *                         gadtools.library uses.
  3178. *
  3179. *            GA_Immediate (BOOL) - Hear every IDCMP_GADGETDOWN
  3180. *                event from scroller
  3181. *                Default: TRUE
  3182. *
  3183. *                        NOTE: This is different from what
  3184. *                         gadtools.library uses.
  3185. *
  3186. *        TAPEDECK_KIND:
  3187. *
  3188. *            LATD_ButtonType (LONG) - Select the image to display
  3189. *                in the button, must be one of the following:
  3190. *
  3191. *                    TDBT_BACKWARD
  3192. *                        "<<" Symbol
  3193. *
  3194. *                    TDBT_FORWARD
  3195. *                        ">>" Symbol
  3196. *
  3197. *                    TDBT_PREVIOUS
  3198. *                        "|<" Symbol
  3199. *
  3200. *                    TDBT_NEXT
  3201. *                        ">|" Symbol
  3202. *
  3203. *                    TDBT_STOP
  3204. *                        Stop symbol (filled square)
  3205. *
  3206. *                    TDBT_PAUSE
  3207. *                        "||" pause symbol (broken square)
  3208. *
  3209. *                    TDBT_RECORD
  3210. *                        Record symbol (filled circle)
  3211. *
  3212. *                    TDBT_REWIND
  3213. *                        "<" symbol
  3214. *
  3215. *                    TDBT_EJECT
  3216. *                        Eject symbol (broken upward pointing arrow)
  3217. *
  3218. *                    TDBT_PLAY
  3219. *                        ">" symbol
  3220. *
  3221. *            LATD_Toggle (BOOL) - Make this object a toggle-select
  3222. *                button.
  3223. *                Default: FALSE
  3224. *
  3225. *            LATD_Pressed (BOOL) - Make this button appear to be
  3226. *                pressed.
  3227. *
  3228. *                    NOTE: requires "LATD_Toggle,TRUE" attribute.
  3229. *
  3230. *                Default: FALSE
  3231. *
  3232. *            LATD_Smaller (BOOL) - Make this button a bit smaller
  3233. *                than usual.
  3234. *                Default: FALSE
  3235. *
  3236. *            LATD_Tick (BOOL) - Hear IDCMP_GADGETUP events while the
  3237. *                buttons is being pressed; the IntuiMessage->Code entry
  3238. *                will be 0 while the button is being pressed, and
  3239. *                will be 1 as soon as the button is released. (V12)
  3240. *
  3241. *                Default: FALSE
  3242. *
  3243. *
  3244. *        BOOPSI_KIND:
  3245. *
  3246. *            (requires gtlayout.library v10 or higher)
  3247. *
  3248. *            LABO_TagCurrent (Tag) - The Tag ID that represents the
  3249. *                current object value. For PROPGCLASS this would be
  3250. *                PGA_Top.
  3251. *
  3252. *            LABO_TagTextAttr (Tag) - The Tag ID that represents the
  3253. *                TextAttr value the object expects. For gadgets this
  3254. *                would be GA_TextAttr.
  3255. *
  3256. *            LABO_TagDrawInfo (Tag) - The Tag ID that represents the
  3257. *                DrawInfo value the object expects.
  3258. *
  3259. *            LABO_TagLink (Tag) - The Tag ID that represents a pointer
  3260. *                to a different object the object expects. For the
  3261. *                colorwheel.gadget this would be WHEEL_GradientSlider.
  3262. *
  3263. *            LABO_TagScreen (Tag) - The Tag ID that represents the
  3264. *                screen the object expects. For the colorwheel.gadget
  3265. *                this would be WHEEL_Screen.
  3266. *
  3267. *            LABO_Link (LONG) - The ID of the object this object should
  3268. *                be linked to. This will be resolved later when gadgets
  3269. *                are created.
  3270. *
  3271. *                    NOTE: Forward references are not resolved, only
  3272. *                        backward references are allowed. This means that
  3273. *                        if you wish to link object A to object B,
  3274. *                        object A must be created before object B
  3275. *                        is created.
  3276. *
  3277. *            LABO_ClassInstance (Class *) - This is the first parameter
  3278. *                you would pass to NewObjectA().
  3279. *
  3280. *                    NOTE: Only classes derived from gadgetclass and
  3281. *                      gadgetclass itself may be used.
  3282. *
  3283. *            LABO_ClassName (STRPTR) - This is the second parameter you would
  3284. *                pass to NewObject().
  3285. *
  3286. *                    NOTE: Only classes derived from gadgetclass and
  3287. *                        gadgetclass itself may be used.
  3288. *
  3289. *            LABO_ClassLibraryName (STRPTR) - This tag is particularly useful
  3290. *                for gadget class implementations wrapped into libraries, such as
  3291. *                colorwheel.gadget. When opened, they make the classes they
  3292. *                represent publicly available so subsequent calls to
  3293. *                NewObject(NULL,<Classname>,...) can be made. The
  3294. *                LABO_ClassLibraryName tag will cause gtlayout.library to open
  3295. *                the class library before any calls to NewObject() are made.
  3296. *
  3297. *                    NOTE: Only classes derived from gadgetclass and
  3298. *                        gadgetclass itself may be used.
  3299. *
  3300. *                        The LABO_ClassLibraryName tag requires that you
  3301. *                        specify the class name with the LABO_ClassName. It is
  3302. *                        not enough to just use the LABO_ClassLibraryName tag.
  3303. *
  3304. *            LABO_ExactWidth (WORD) - This is the exact width of the object to
  3305. *                use. This effectively overrides whatever you specified using
  3306. *                the LA_Chars tag and keeps gtlayout.library from shrinking and
  3307. *                expanding the object as needed.
  3308. *
  3309. *            LABO_ExactHeight (WORD) - This is the exact height of the object to
  3310. *                use. This effectively overrides whatever you specified using
  3311. *                the LA_Lines tag and keeps gtlayout.library from shrinking and
  3312. *                expanding the object as needed.
  3313. *
  3314. *            LABO_RelFontHeight (WORD) - This tag affects the height of the
  3315. *                object; when specified, it is derived from the user interface
  3316. *                font height plus the value given with LABO_RelFontHeight.
  3317. *
  3318. *            LABO_FullWidth (BOOL) - Use this tag if you wish the object to
  3319. *                cover the entire width of the group it resides within.
  3320. *
  3321. *            LABO_FullHeight (BOOL) - Use this tag if you wish the object to
  3322. *                cover the entire height of the group it resides within.
  3323. *
  3324. *            LABO_ActivateHook (struct Hook *) - Hook to invoke when the
  3325. *                layout engine decides that this particular object should
  3326. *                be activated. The hook is called with the following
  3327. *                parameters:
  3328. *
  3329. *                Success = ActivateFunc(struct Hook *Hook,LayoutHandle *Handle,
  3330. *                  D0                                 A0                  A2
  3331. *
  3332. *                             Object *object)
  3333. *                                       A1
  3334. *
  3335. *                The object pointer actually refers to the instance of the
  3336. *                BOOPSI object created. Return FALSE if your object could not
  3337. *                be activated, TRUE if it worked. If you return TRUE, no special
  3338. *                keyboard event will be generated. (V13)
  3339. *
  3340. *            NOTE: All tags passed to LT_New() for BOOPSI_KIND objects are
  3341. *                passed through to NewObjectA() later. The library makes
  3342. *                a copy of the tag item list, so all data valid in the
  3343. *                scope when LT_New() is called must also be valid later
  3344. *                when LT_Build() is invoked.
  3345. *
  3346. *                The gadget label is *NOT* passed through to the object,
  3347. *                it effectively receives the label a plain gadtools object
  3348. *                would receive, similar to what happens to FRAME_KIND
  3349. *                objects and the like.
  3350. *
  3351. *   RESULT
  3352. *    none
  3353. *
  3354. *   BUGS
  3355. *    Up to v25 the SCROLLER_KIND object did not support GA_Immediate
  3356. *    or GA_RelVerify. The space for the variables was there, but the
  3357. *    code was missing.
  3358. *
  3359. *    POPUP_KIND objects don't work well in simple refresh windows,
  3360. *    as refresh events can get lost. Use a smart refresh window
  3361. *    instead or call gadtools.library/LT_CatchUpRefresh() regularly.
  3362. *
  3363. *   SEE ALSO
  3364. *    gadtools.library/CreateGadgetA
  3365. *
  3366. ******************************************************************************
  3367. *
  3368. */
  3369.  
  3370. VOID LIBENT
  3371. LT_NewA(REG(a0) LayoutHandle *handle,REG(a1) struct TagItem *tagList)
  3372. {
  3373.     if(handle)
  3374.     {
  3375.         struct TagItem *List,*Entry;
  3376.         STRPTR label;
  3377.         LONG type;
  3378.         LONG id;
  3379.  
  3380.         type    = -1;
  3381.         label    = NULL;
  3382.         id        = 0;
  3383.         List    = tagList;
  3384.  
  3385.         while(Entry = NextTagItem(&List))
  3386.         {
  3387.             switch(Entry->ti_Tag)
  3388.             {
  3389.                 case LA_Type:
  3390.  
  3391.                     type = Entry->ti_Data;
  3392.                     break;
  3393.  
  3394.                 case LA_ID:
  3395.  
  3396.                     id = Entry->ti_Data;
  3397.                     break;
  3398.  
  3399.                 case LA_LabelID:
  3400.  
  3401.                     if(handle->LocaleHook)
  3402.                         label = (STRPTR)CallHookPkt(handle->LocaleHook,handle,(APTR)Entry->ti_Data);
  3403.                     else
  3404.                     {
  3405.                         handle->Failed = TRUE;
  3406.  
  3407.                         return;
  3408.                     }
  3409.  
  3410.                     break;
  3411.  
  3412.                 case LA_LabelText:
  3413.  
  3414.                     label = (STRPTR)Entry->ti_Data;
  3415.                     break;
  3416.             }
  3417.         }
  3418.  
  3419.         LT_AddA(handle,type,label,id,tagList);
  3420.     }
  3421. }
  3422.  
  3423.  
  3424. /*****************************************************************************/
  3425.  
  3426.  
  3427. /****** gtlayout.library/LT_EndGroup ******************************************
  3428. *
  3429. *   NAME
  3430. *    LT_EndGroup -- end a group declaration.
  3431. *
  3432. *   SYNOPSIS
  3433. *    LT_EndGroup(Handle);
  3434. *                 A0
  3435. *
  3436. *    VOID LT_EndGroup(LayoutHandle *);
  3437. *
  3438. *   FUNCTION
  3439. *      This is just a short form of
  3440. *
  3441. *           LT_New(Handle,
  3442. *               LA_Type, END_KIND,
  3443. *           TAG_DONE);
  3444. *
  3445. *      It helps to save (some) space.
  3446. *
  3447. *   INPUTS
  3448. *        Handle - Pointer to LayoutHandle.
  3449. *
  3450. *   RESULT
  3451. *    none
  3452. *
  3453. *   SEE ALSO
  3454. *    gtlayout.library/LT_New
  3455. *
  3456. ******************************************************************************
  3457. *
  3458. */
  3459.  
  3460. VOID LIBENT
  3461. LT_EndGroup(REG(a0) LayoutHandle *handle)
  3462. {
  3463.     if(handle && !handle->Failed)
  3464.         handle->CurrentGroup = handle->CurrentGroup->Special.Group.ParentGroup;
  3465. }
  3466.